geomagnetism icon indicating copy to clipboard operation
geomagnetism copied to clipboard

compute fractional year in same time zone as model

Open wallw-teal opened this issue 7 years ago • 1 comments

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 avatar Jan 05 '18 00:01 wallw-teal

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.

wallw-teal avatar Jan 05 '18 00:01 wallw-teal