[Koha-bugs] [Bug 24980] Date formatting from JS - use timezone only with dates with offset

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 27 13:48:10 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24980

--- Comment #10 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
OK.. so my understanding of why we need to support timezone in this js function
at all is that we are effectively replacing the native toLocalDateString(). 
That function, in my understanding, does too things.. it converts Date
prototypes to a locale based formatted string and also ensures the output is in
the local timezone (if the original Date prototype has a timezone associated
with it upon creation).

Our function takes an RFC3339 formatted string, which is what the API returns.
These strings have timezones attached, if we used toLocalDateString to output
them, then we would get the timezone of the browser applied.. which may differ
from our koha instances configured timezone.. and thus the one that all our
templates currently output in.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list