spencermountain / spacetime

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

DST is applying already in USA? #267

Closed beliolfa closed 3 years ago

beliolfa commented 3 years ago

I noticed on a site that I have in production that is showing a difference of 1 hour since March 8 although DST starts next weekend.

I took a look at the library tests and they rely on March 8 of 2020 for testing but it looks like 2021 is wrong?

Is there something I can do to fix that or it is in fact a bug?

spacetime('2021-03-11 00:00:00', 'UTC').goto('America/New_York').format('{month} {date-pad} - {hour}:{minute-pad} {ampm}')

Expected output March 10 - 7:00 pm Given output March 10 - 8:00 pm

Thank you!

beliolfa commented 3 years ago

Sorry, I've updated to the latest version and it is now fixed!

spencermountain commented 3 years ago

thanks Javier, I'm working on a version that won't need to be updated each year.