spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.98k stars 183 forks source link

near-DST inconsistency in PST #252

Open lukasfroehlich1 opened 3 years ago

lukasfroehlich1 commented 3 years ago

Hi,

I'm interested in contributing to the library but I'm unable to get the daylight savings test cases passing after pulling from master. I'm currently based in mountain time and when I update my system clock to Toronto the tests end up passing. I'm happy to take a stab at fixing the issue but would love a hint to get me started.

Thanks!

spencermountain commented 3 years ago

whoa! i just reproduced this. sorry - I thought these days were past. Feel-free to ignore these, i will take a look at them. Thanks for the heads-up. 😅

spencermountain commented 3 years ago

yeah, looks like it's #235 again - off by an hour, within an hour of a DST change:

let d = spacetime('2020-11-01T01:32:00.000-06:00')
console.log(d.time()) // 1:32am
d = d.add(30, 'minutes')
console.log(d.time() === '2:02am') // 1:02am

the tests pass in all the other locales I tried, briefly. Will take a closer look when I have some time. cheers

ericawilson9 commented 3 years ago

@spencermountainwere you able to resolve this issue? Experienced this issue in production starting yesterday (Monday, March 8th, 2021)...one year after daylight savings 2020. Any insight would be greatly appreciated.

My interpretation is, It’s basically only occurring if the user device is set to CST timezone and DST is like on that day. I can’t exactly figure out the full window where this occurs. Best I can tell is it translates the wrong time the entire day of DST except for 7-9pm EST

Literally bringing my team down to our knees lol

spencermountain commented 3 years ago

whoa - @ericawilson9 if you wanna join a skype call today or something, my email is spencermountain@gmail.com

yeah, I don't understand why the entire day would be effected. The only effect of this (known) bug is that people in 1-2am may think they're in 2-3am, which they would be soon, anyways. I've always understood it to be very minor.

It sounds like you're running on an older version - and this edge-case has improved since. It may be worth trying. Let me know if I can help. The within-1-hour issue still exists, but you may be experiencing something else. cheers