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

Date.parse should return a Double, not an Int #1324

Closed
michelschinz opened this issue Nov 28, 2014 · 5 comments
Closed

Date.parse should return a Double, not an Int #1324

michelschinz opened this issue Nov 28, 2014 · 5 comments
Assignees
Labels
bug Confirmed bug. Needs to be fixed.
Milestone

Comments

@michelschinz
Copy link

Hi,
In library/src/main/scala/scala/scalajs/js/Date.scala, the parse method of the Date object is declared as returning an Int. This should be changed to Double.

@gzm0 gzm0 added this to the v0.6.0 milestone Nov 28, 2014
@sjrd sjrd added the bug Confirmed bug. Needs to be fixed. label Nov 28, 2014
@sjrd sjrd modified the milestones: v0.6.0-M1, v0.6.0 Nov 28, 2014
@gzm0
Copy link
Contributor

gzm0 commented Nov 28, 2014

Thanks for the report

@gzm0 gzm0 self-assigned this Nov 28, 2014
@gzm0 gzm0 closed this as completed in 95934a5 Nov 28, 2014
gzm0 added a commit that referenced this issue Nov 28, 2014
Fix #1324: js.Date.parse should return Double
@matthughes
Copy link

@michelschinz Out of curiosity, why Double and not Long?

@sjrd
Copy link
Member

sjrd commented Feb 6, 2015

Because Long is an opaque type: it doesn't map to any JavaScript type.

@michelschinz
Copy link
Author

...and because parse returns NaN in case of error.

@sjrd
Copy link
Member

sjrd commented Feb 6, 2015

Oh, I didn't even know that ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug. Needs to be fixed.
Projects
None yet
Development

No branches or pull requests

4 participants