Skip to content
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

7.6.0 to 7.6.1 breaks DST boundary startOf('day') #424

Open
HowieSquires opened this issue Jan 3, 2025 · 4 comments
Open

7.6.0 to 7.6.1 breaks DST boundary startOf('day') #424

HowieSquires opened this issue Jan 3, 2025 · 4 comments

Comments

@HowieSquires
Copy link

After upgrading from 7.6.0 to 7.7.0 for the latest 2025 DST boundaries, I noticed that one of the Jest tests we run has broken.

Previously
spacetime('2024-03-31 01:00', 'Europe/London').startOf('day')

would return -

2024-03-31 00:00

However, it's now returning -

2024-03-31 01:00.

I played between the other updates between 7.6.0 and 7.7.0 and noticed the error occurs between 7.6.0 and 7.6.1.

@HowieSquires
Copy link
Author

HowieSquires commented Jan 3, 2025

@spencermountain Further to this:

spacetime('2024-03-31 01:00', 'Europe/London').format('iso') = 2024-03-31 00:00

spacetime('2024-03-31 02:00', 'Europe/London').format('iso') = 2024-03-31 00:00

spacetime('2024-03-31 03:00', 'Europe/London').format('iso') = 2024-03-31 02:00

This is strange behaviour as the second one using 02:00 should either be 01:00 or stay at 02:00.

@spencermountain
Copy link
Owner

hey Howie, yep - this looks like this issue where we struggle to know the exact hour, within 1 hour of a DST change. This is because we're using native js dates internally, to represent remote dates, and there's a small overlap where we can't resolve it.
Sorry about that. was hoping to fix it in 2024, but it's a real tough one.
cheers

@HowieSquires
Copy link
Author

@spencermountain Is it not a case of fixing the breaking change between 7.6.0 and 7.6.1? I'm not sure what changed?

@spencermountain
Copy link
Owner

Ya, I think it's maybe the date of the daylight savings change that could have changed between the versions. I haven't checked this, but the DST change is on that day, and it looks to be an hour off.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants