Skip to content

fix test in interval.test.ts for machines in BST #53

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

jamesscottbrown
Copy link
Contributor

@jamesscottbrown jamesscottbrown commented May 22, 2025

The time 2025-04-16T23:00:00Z is Thu Apr 17 2025 00:00:00 GMT+0100 (British Summer Time).

When the test is run on a machine with the timezone set to BST, the test fails as this time is at midnight in BST, so it lies exactly on a day boundary, so item.__x1 and item.x are equal.

The test would also pass if a minute or seconds offset was applied to the test time, so it didn't correspond to exactly midnight (adding an offset of an integer number of hours would fix the issue for systems running BST, but create a problem for some other timezone).

(Possibly there is actually a bug, and the intervals should be constructed by using midnight UTC as the day boundary, igoring the system timezone - I'm not sure what the correct expected behaviour is).

Copy link

netlify bot commented May 22, 2025

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit e80859f
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/682f4883a027b000080d55ca
😎 Deploy Preview https://deploy-preview-53--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gka
Copy link
Contributor

gka commented May 22, 2025

(Possibly there is actually a bug, and the intervals should be constructed by using midnight UTC as the day boundary, igoring the system timezone - I'm not sure what the correct expected behaviour is).

In Observable Plot you have the choice between using utc or time as scale type, and I think both have valid use cases. Proper UTC support is still on the list of todos in SveltePlot.

@gka gka merged commit 8819ed9 into svelteplot:main May 22, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy