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

compute fractional year in same time zone as model #2

Closed

Conversation

wallw-teal
Copy link

The fractional year time computation in model.js was using local dates, the valueOf which can vary greatly with the user's - or server's - local timezone. UTC dates should be used because they coincide with the proper timezone in the model itself.

This was found by noticing a slight drift in values when running unit tests in CI (GMT) vs. our local dev timezone, despite sending a constant new Date(1488386496470) in the test itself.

That particular portion of this library is a little difficult to write a unit test for, or I would have added it. Also, this change should allow you to drastically increase the precision with which each value is tested.

@wallw-teal
Copy link
Author

I am not sure what is going on with the build there. Both test and test-ci pass locally for me. I am running a much newer version of node though.

@brianreavis
Copy link
Member

Fixed by #9

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