[horde] Setting date and time preferences

Jan Schneider jan at horde.org
Wed Apr 22 07:14:19 UTC 2015


Zitat von Jens Wahnes <wahnes at uni-koeln.de>:

> On Tue, Apr 21 2015, at 21:12:01 +0200, Jan Schneider wrote:
>
>>> For instance, the default date format seems to be set depending on
>>> the locale, but the time format isn't (i.e., it remains with 12 hour
>>> time even with locales that would ordinarily use 24 hour time). Is
>>> that on purpose?
>
>> Yes. While the date format preference can take arbitrary format
>> specifiers (that don't even need to actually display a date), the dates
>> in the dynamic interface of Kronolith need to be parseable. Thus we need
>> to make sure to have a format that we actually can read back. Otherwise
>> we would have to use date pickers like in the basic view.
>
> Maybe I didn't make myself quite clear, or maybe I don't understand
> what you are saying.
>
> I can see that the date format needs to be parsable and thus handling
> dates is not as easy as just displaying "date +%x" (in shell terms) by
> default, but I can't really see why the same argument would not apply
> to time format as well? The time values a user enters into Kronolith
> will need to be parsed according to this user's current time settings
> as well, won't they?
>
> Or yet another way to put it: There seems to be code that derives a
> default date format from the locale, but then why isn't there code that
> does the same for the "twentyFour" preference?
>
> Just to make sure we're on the same page, here are two screenshots to
> illustrate what I'm referring to:
>
> http://666kb.com/i/cxzgeot5os6oy51wh.png
>
> Here, I logged into Horde with English language settings and opened up
> an example event. Note that the date is displayed as "05/01/2015", that
> is month first, then day, then year.
>
> http://666kb.com/i/cxzggii6x5uo2clpd.png
>
> This time, I logged into Horde with German language and displayed the
> same event. Note that the date shows "01.05.2015" just as one would
> expect for this locale (day first, then month, then year, all separated
> by dots), but the time remains "07:00 PM" which one would not expect in
> this locale.

This is because there are only two time formats, 24-hour or 12-hour.  
So we *can* use the user's preference here, because the freely entered  
time is distinguishable. Dates based on user preferences are not.

>>> So, what's the right way to set defaults for these values?
>> See the other reply
>
> Are you referring to Mauricio's message? That didn't really help me
> out, and, so far, I didn't receive any other reply.

Yes, and I've seen your reply. I had refered to him, because having  
set individual preference values is the only reason why default values  
(or hooks) won't be used.

-- 
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject



More information about the horde mailing list