[#14274] Embedded views fall back to american date and time format
Summary Embedded views fall back to american date and time format
Queue Kronolith
Queue Version 4.2.15
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk@horde.org
Requester fer.grub@yahoo.de
Created 2016-02-29 (1299 days ago)
Due
Updated 2016-03-03 (1296 days ago)
Assigned 2016-02-29 (1299 days ago)
Resolved 2016-03-02 (1297 days ago)
Milestone
Patch No

Comments
fer.grub@yahoo.de 2016-02-29 15:14:06
I tried to embed some calendar views into my web project.

The embedded calendar views do not display the local time format.
All times are given in american format, (12 hours), first day of week 
is sunday and so on.

But after login on the horde server the calendar events are displayed 
in the right format.

I tried the following options in /horde/config/prefs.local.php

   $_prefs['twentyFour']['value'] = true;
   $_prefs['first_week_day']['value'] = '1';

But that did not change anything on the calendar views on my website.

Michael Rubinsky <mrubinsk@horde.org> 2016-03-02 16:02:46
I think this is some sort of preference caching going on. If I change 
the default preference then load the page, it still shows the old 
value. If I log in, then immediately log out, then load the embedded 
page, it shows the correct value - regardless of what the user who 
just logged in has the pref set to.

Michael Rubinsky <mrubinsk@horde.org> 2016-03-02 16:31:18
Yup. This is due to session caching. Not a bug. Either clear the 
session cache on the server or remove the cookie associated with the 
guest session on the browser.

fer.gru@yahoo.de 2016-03-02 18:01:36
If I edit the calendar as guest, all the date values appear in 
american format.

Now I open a second browser tab and log in as user.  Now all date 
values are in german format as expected.
Now I switch to the first tab, where I started editing as guest. Now 
also in this view all values are displayed in the local format.

Now I log out on the second browser window.
Suddenly all date values on the other browser window fall back into 
american format.

How can this bahaviour be changed?
Sorry, don't understand your suggestion concerning the session cache. 
Could you please explain that more specific?

Michael Rubinsky <mrubinsk@horde.org> 2016-03-02 18:09:42
> If I edit the calendar as guest, all the date values appear in 
> american format.
>
> Now I open a second browser tab and log in as user.  Now all date 
> values are in german format as expected.
> Now I switch to the first tab, where I started editing as guest. Now 
> also in this view all values are displayed in the local format.
>
> Now I log out on the second browser window.
> Suddenly all date values on the other browser window fall back into 
> american format.

Then the default value for these prefs were not changed in prefs.local.php


> How can this bahaviour be changed?
> Sorry, don't understand your suggestion concerning the session 
> cache. Could you please explain that more specific?

For guest users preference values are cached in the guest session. If 
the default values of these prefs were changed (by editing 
prefs.local.php) you need to remove the browser's cookie, or otherwise 
force a new session.

fer.gru@yahoo.de 2016-03-02 18:39:55
I set this two values in /horde/config/prefs.local.php:
    $_prefs['first_week_day']['value'] = '1';
    $_prefs['twentyFour']['value'] = true;
Is this not enough? Why do this settings have no effect?
Are there additional options necessary?

fer.grub@yahoo.de 2016-03-02 18:54:21
Now I made one more test, and oh: The date values now are displayed in 
german format (24 hours).
But the first day of week remains sunday.

    $_prefs['first_week_day']['value'] = '1';

Is this option not correct?


Michael Rubinsky <mrubinsk@horde.org> 2016-03-02 19:04:16
> I set this two values in /horde/config/prefs.local.php:
>    $_prefs['first_week_day']['value'] = '1';
>    $_prefs['twentyFour']['value'] = true;
> Is this not enough?

These will only change the first day of week and the twenty four hour 
prefs. Nothing else, not date format, not language etc...

> Why do this settings have no effect?

I already explained this.


> Are there additional options necessary?

Please use the mailing list for further support since this is not a bug.

fer.grub@yahoo.de 2016-03-02 21:22:41
Please allow me to explain what I consider to be possibly a bug:

The date formats in the embedded views of the guest user are correct, BUT:

After I click on one of the links in the embedded view, that opens the 
corresponding calendar view, and I switch to the months view, than 
this view is displayed with Sunday as first day of the week.

But i have set in prefs.local.php:

     $_prefs['first_week_day']['value'] = '1';

Sorry, I cannot consider this as expected behaviour. Anyway the above 
setting seems to have no effect in the months view.

Michael Rubinsky <mrubinsk@horde.org> 2016-03-03 02:57:16
> Please allow me to explain what I consider to be possibly a bug:
>
> The date formats in the embedded views of the guest user are correct, BUT:
>
> After I click on one of the links in the embedded view, that opens 
> the corresponding calendar view, and I switch to the months view, 
> than this view is displayed with Sunday as first day of the week.
>
> But i have set in prefs.local.php:
>
>     $_prefs['first_week_day']['value'] = '1';

Kronolith also has it's own value of this preference in current stable 
code: The 'first_week_day' pref in kronolith/config/prefs.php. 
Likewise, there are date/time display format prefs local to kronolith 
as well. This was for legacy reasons (some of the kronolith prefs 
predated the more global horde prefs and this is changed in our Horde 
6 code).