ltb-project / service-desk

Application for support team who need to check and reset user passwords
https://service-desk.readthedocs.io/
GNU General Public License v3.0
49 stars 19 forks source link

Display localized time #110

Closed davidcoutadeur closed 5 months ago

davidcoutadeur commented 7 months ago

Currently, when an account is locked, we display the time stored in pwdAccountLockedTime. For example:

pwdAccountLockedTime: 20231124084929Z

Self Service password displays:

Automatic unlock date: 25/11/2023 - 08:49:29 (UTC)

We could have an option to display localized time: 25/11/2023 - 09:49:29

coudot commented 7 months ago

The time format can be configured with $date_specifiers: https://service-desk.readthedocs.io/en/stable/general-parameters.html#dates

So you can easily display the UTC information

We should indeed add a feature to change the time zone

davidcoutadeur commented 7 months ago

Seems the date is already configured to display the timezone, but it is not working:

$date_specifiers = "%Y-%m-%d %H:%M:%S (%Z)"
<p>{$msg_unlockdate} {$unlockDate|date_format:{$date_specifiers}}</p>

Maybe a bug in smarty or a feature not available in our version

coudot commented 7 months ago

To change time zone: https://github.com/ltb-project/service-desk/blob/master/lib/date.inc.php#L68C20-L68C20

coudot commented 7 months ago

https://www.smarty.net/docsv2/fr/language.modifier.date.format.tpl

davidcoutadeur commented 7 months ago

The date_specifiers was overloaded somewhere. Sorry for the noise.

I keep the issue opened for the new feature to display localized time, which could be interesting IMO.

davidcoutadeur commented 6 months ago

Should be ok with #111