[Tickets #13947] Re: Calendar breaks on DST start date
noreply at bugs.horde.org
noreply at bugs.horde.org
Mon Apr 13 17:50:57 UTC 2015
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/13947
------------------------------------------------------------------------------
Ticket | 13947
Updated By | jsveiga at it.eng.br
Summary | Calendar breaks on DST start date
Queue | Kronolith
Version | 4.2.2
Type | Bug
State | Feedback
Priority | 2. Medium
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
jsveiga at it.eng.br (2015-04-13 17:50) wrote:
> It's a bug with the DateJS library then.
(sorry if I'm flooding this with comments; let me know and I'll be quiet)
It is hard to call that a bug, because there is no "right" way to do
it. Just adding 1 to the month day number would be wrong, because
"Date" is actually a "DateTime", so the time has to be taken into
account too.
If you think about it, 00:00 - 00:59 October 18th 2015 does not exist
in my timezone because at 23:59:59.99 on the 17th you set your clock
to 01:00:00.00 (and each DST-using timezone has such gap).
So adding 1 day to "Oct 17th 00:00" cannot result in "Oct 18th 00:00"
as that is an invalid datetime in this timezone. IMO, the "best"
result would be that the .add or .next methods returned an "invalid
date", and left it to the calling program to decide what to do.
Instead, each implementation seems to "decide" what to return (in some
Android cases, it's 31/12/1969 00:00!).
So when we are just interested in the Date and not Time, it is much
safer to set the time to something far from 00:00 (some timezones
switch at 01:00) before doing date math.
More information about the bugs
mailing list