-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not rezone dates to prevent doubly applying offset. Accommodate relevant tests. #357
Conversation
Codecov Report
@@ Coverage Diff @@
## master #357 +/- ##
=========================================
- Coverage 90.06% 89.9% -0.16%
=========================================
Files 28 28
Lines 1962 1931 -31
Branches 583 581 -2
=========================================
- Hits 1767 1736 -31
Misses 195 195
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for contributing & investing in this library. However, I don't think this is a good change; it basically breaks timezone support, which is a feature used by some clients. Moreover, the desired behavior is already present if you simply do not provide a tzid
param.
There has been some confusion around how & when to use tzid
. This is partly because JS Date objects natively have poor, inconsistent, confusing, or nonexistent timezone support.
The vast majority (90%) of use cases for this library should not require tzid
. tzid
is only useful if you want to represent a date in one non-UTC timezone in a different non-UTC timezone. For example, if you want to represent a repeating event that happens in Tokyo, and get the resulting dates in New York time (eg 10pm in Japan is 9am in New York). If your users only ever want recurrences represented in one timezone, whether UTC or their local timezone, tzid
should not be used.
Sooner than later I will have to take the time to write a more definitive article explaining all of this, since the README doesn't seem to get the message across effectively. Until then, however, this change is both unnecessary and harmful. Let me know if you have any further questions!
Hi there, and thanks for the very quick and detailed feedback. I do agree that JavaScript I have found that when using properly instantiated I don't believe that rezoning the I realize that perhaps something may be lost in translation and that we may not agree, but perhaps we can get a third opinion on this? I think we could benefit from seeing the results of others' attempts at reproducing this issue. @jakubroztocil |
Ahh, I see my mistake. It looks like the DTSTART value should be the local time when a TZID is passed in, and my server code was not handling that. Apologies for the confusion, hope you have a great rest of your day. I will take a look at this further and if something pops up I will be sure to file an issue, but until then I'll see if I can't solve this and leave a helpful comment in the Github issues mentioned above to try to get the original poster on his way. |
This bugfix addresses the bugs raised by the following issues, removing the additional offset applied by 'rezoning' that would see non-UTC times have their offset applied twice instead of once:
#355
#356
Since JavaScript
Date
objects track time via elapsed time since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, applying an additional offset (i.e. 'rezoning') these dates should not be necessary as long as theDate
was instantiated correctly.