spencermountain / spacetime

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

startOf not giving correct date #307

Closed boyanraichev closed 2 years ago

boyanraichev commented 2 years ago

I am having a very weird issue. I was startOf('week') to get the Monday of the week. It works correctly for many dates and suddenly when I try 2021-10-31 it gives a wrong result.

spacetime('2021-10-31').startOf('week').format('{iso-short}')

I get 2021-10-28 instead of 2021-10-25...

I thought it could be because of DTS, but I tried the DTS Sunday of other years and it was OK.

boyanraichev commented 2 years ago

I was using 6.13.2. Updating to 6.13.3 seems to fix the issue.