-
Notifications
You must be signed in to change notification settings - Fork 184
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
Unexpected behaviour from at least isEqual() when using UNIX epoch date (1970-01-01) #417
Comments
Possible this affects other functions too, but have not yet checked. |
hey Chris, thanks for the issue. I don't see any nulls, when I do this: console.log(spacetime('1970-01-01').isEqual('1970-01-01'))
console.log(spacetime('1970-01-02').isEqual('1970-01-02'))
console.log(spacetime('1970-01-02').isEqual('1970-01-01'))
console.log(spacetime('1970-01-01').isEqual('1970-01-02')) same thing in the repl - how did you produce this null response? You're right, that it should be a boolean always. |
Are you testing on a more recent (dev?) version? Here's a copy of Firefox's console output for your examples run on https://spacetime.how/
|
I've worked out why: we are both avoiding the obvious and also super pertinent elephant in the room, the timezone! It only behaves this way with a GMT/UTC/London timezone, where the epoch is equal to zero.
Lines 59 to 71 in 0464eca
|
haha, thank you. busted by pertinent elephant again. |
released as |
Should only return null when passed an invalid date?
The text was updated successfully, but these errors were encountered: