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

Tests fail if you're west of UTC because local date != UTC date #2

Open
evanp opened this issue Mar 21, 2018 · 0 comments
Open

Tests fail if you're west of UTC because local date != UTC date #2

evanp opened this issue Mar 21, 2018 · 0 comments

Comments

@evanp
Copy link
Contributor

evanp commented Mar 21, 2018

There's a mixing of dates in the code and test suite between "local" and "UTC" dates, which is probably fine if you're east of Greenwich, and which causes errors if you're not.

This command will give passing tests:

TZ=Europe/Paris npm test

This command will give failing tests:

TZ=America/New_York npm test

I think the proper handling should be to use the user's local timezone for all dates, since that's what people probably mean when they set a date in their todo.txt file.

It might be nice to add a way for parse(), stringify() and item() to take a separate timezone argument, so if you're doing development where the user's timezone isn't the same as the system timezone (say, for a Web application), you can pass the user's timezone in. I'll add that as another issue.

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

1 participant