Skip to content

Date.fromString not implemented in VM #1728

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
sethladd opened this issue Feb 17, 2012 · 15 comments
Closed

Date.fromString not implemented in VM #1728

sethladd opened this issue Feb 17, 2012 · 15 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@sethladd
Copy link
Contributor

Our sample app is developed with Editor and tested in Dartium. We found that Date.fromString is not yet implemented.

This would be very nice to have.

@andersjohnsen
Copy link

I've found the need for this as well. Especially support for parsing ISO 8601 would be nice to have.

@ghost
Copy link

ghost commented Feb 23, 2012

Date.fromString is partially implemented, e.g., in VM the following works:
var dt1 = new Date.fromString("2011-05-11 18:58:35Z");

Please provide strings that are not parseable.

@floitschG
Copy link
Contributor

Marked this as being blocked by #1878.

@andersjohnsen
Copy link

I would like the following to be parsable.

2012-02-21T12:00:16.371867Z

@ghost
Copy link

ghost commented Feb 28, 2012

Florian, can you please have a look at this or comment?


Set owner to @floitschG.

@floitschG
Copy link
Contributor

working on it.
I have already a CL prepared for that (it was only accepting 3 digits after the last dot, but that's trivial to change).
Just need some minutes to clean it up. Hopefully this week. If you don't see any progress please ping me.


Added Accepted label.

@andersjohnsen
Copy link

Thank you! :)

@andersjohnsen
Copy link

When we encounter a bad date, I see this output:

Unhandled exception:
UNIMPLEMENTED
 0. Function: 'DateImplementation.DateImplementation.fromString' url: 'bootstrap_impl' line:481 col:33

It would be nice if it could print something along the lines of

"DateImplementation.fromString" failed to parse '<the-date>'"

so I can debug it better.

This should of cause be an Exception one day. :)

Thank you,

  • Anders

@floitschG
Copy link
Contributor

Just committed r4923.
All platforms should now support the same sub/super set of ISO 8601. If the string is not recognized an IllegalArgumentException is thrown.
I will leave this bug open, blocked on 1878. Once the Date.fromString is fully specified we will probably have to revisit the implementation.

Hmm. just saw that ajohnsen was requesting 6 digits after the comma. I will see if I can cook up a patch for that. (Currently there are only 5 digits allowed). In any case the additional digits don't add any precision, since we round to the closest ms.


Removed the owner.
Added Triaged label.

@DartBot
Copy link

DartBot commented Mar 4, 2012

This comment was originally written by [email protected]


Thank you for working on this!

The date I have is from svn log --xml. I can trim it myself, but it's just nice if the most used formats works as-is.

@floitschG
Copy link
Contributor

Sorry it took so long. Afaics the output (example: "2012-03-30T04:28:13.752341Z") is legal ISO 8601. So I will update the date parser so it accepts this input, too.


Added Accepted label.

@floitschG
Copy link
Contributor

Set owner to @floitschG.

@floitschG
Copy link
Contributor

With r7648 up to 6 digits are now parsed after the decimal point.
This should solve the issue with svn log --xml.
Iso8601 states that both parties have to agree on the number of accepted digits, so there is no "right" solution, but I hope that 6 digits will be good enough for some time.
Still blocked on issue #1878.

@sethladd
Copy link
Contributor Author

Did this get resolved? Can we close?


Marked this as being blocked by #1878.
Unmarked this as being blocked by #1878.

@floitschG
Copy link
Contributor

I will close this bug for now. If we decide to change what Date parsing should accept we will implement it, or open a new bug.


Added Fixed label.

@sethladd sethladd added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Jan 22, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

4 participants