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

new Date(NaN) sets the date to the default date instead of an invalid date #1476

Closed
raskad opened this issue Aug 17, 2021 · 0 comments · Fixed by #1477
Closed

new Date(NaN) sets the date to the default date instead of an invalid date #1476

raskad opened this issue Aug 17, 2021 · 0 comments · Fixed by #1477
Labels
bug Something isn't working
Milestone

Comments

@raskad
Copy link
Member

raskad commented Aug 17, 2021

Describe the bug
When new Date(NaN) is called, the date is being set to the default date, instead to an invalid date.

To Reproduce

This JavaScript code reproduces the issue:

new Date(NaN).toString()

The code returns "Thu Jan 01 1970 01:00:00 GMT+01:00"

Expected behavior
The code should return "Invalid Date"

Build environment:

  • OS: Linux
  • Version: 17c412f
  • Target triple: x86_64-unknown-linux-gnu
  • Rustc version: rustc 1.53.0 (53cb7b09b 2021-06-17)
@raskad raskad added the bug Something isn't working label Aug 17, 2021
@Razican Razican added this to the v0.13.0 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants