Skip to content

Date.fromString not working on FF with dates of the form "2011-12-29 00:02:16" #1472

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

Closed
floitschG opened this issue Feb 2, 2012 · 2 comments
Assignees

Comments

@floitschG
Copy link
Contributor

According to a user report the following does not work in Firefox.
I suspect that we simply call to JS' fromString routine which behaves differently in the Chrome and FF case. Needs investigation, though.
===

String test = "2011-12-29 00:02:16";
Date finishTime = new Date.fromString(test);
print("${finishTime.month}/${finishTime.day}/${finishTime.year}");

prints 12/29/2011 in Chrome but returns Invalid Date in Firefox?
http://try.dartlang.org/s/wQgq

@lrhn
Copy link
Member

lrhn commented Feb 2, 2012

It is a difference in the browsers' Date parsing.
In Firefox, the JS code "new Date('2011-12-29 00:02:16')" yields an invalid date.

This is not a compiler problem as much as a library one, since the formatted string input to Date.fromString isn't specified.

@floitschG
Copy link
Contributor Author

This bug has been fixed with r4630.
We still need the spec to tell us what exactly new Date.fromString should do, though: issue #1878.


Added Fixed label.

This issue was closed.
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

No branches or pull requests

2 participants