-
Notifications
You must be signed in to change notification settings - Fork 12
Bug: TimeZoneTime.setHours does not update timezone offset for DST #20
Comments
That's a tough one, The only real way to update the Let me think about it for a bit. |
What's TimeZoneTime.zone for, if not for region? |
I did find that you can get the zone name from the |
Thanks! |
FYI, looks like setDate also has this issue, as well as the other setter methods. dt = WallTime.UTCToWallTime(new Date('2013-03-15T00:00:00-0500'), 'America/New_York'); // after DST
console.log(dt.getTimezoneOffset()); // correctly prints 240
dt.setDate(1); // set to March 1, i.e., before DST
console.log(dt.getTimezoneOffset()); // incorrectly prints 240, but it should be 300 |
Yes, they all use the same underlying There was a reason I originally did not implement the I'm going to think about it more, but in the mean time you'll have to work around it by using the helper functions that I previously posted; specifically the |
This is your puppy so you decide. But I think it is useful to emulate the native Date object with timezone-awareness, and TimeZoneTime does have reference to its timezone. There are other libraries that operate on Javascript objects, so it would be great to just be able to just pass the TimeZoneTime object as if it were a Date object into these libraries. |
It has a reference to one zone, not the entire set. If you set a date The goal here is not to be the jQuery of date objects, it's to be the one I'm not ruling it out, I'm just gonna marinate on it for a little longer. |
I'm leaving this open as a notice to other people, but the official stance on this right now is that for version 1.0 we'll have another WallTimeDate object that will wrap the TimeZoneTime and perform the set functions. |
Thanks so much Jacob! |
Example:
The text was updated successfully, but these errors were encountered: