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

Specify and extend DateTime.parse #1878

Closed
floitschG opened this Issue Feb 27, 2012 · 20 comments

Comments

Projects
None yet
10 participants
@floitschG
Copy link
Contributor

floitschG commented Feb 27, 2012

We need to specify what Date.fromString should be able to read.
Currently it is implementing (a subset of) ISO 8601.

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented Feb 28, 2012

Marked this as blocking #1728.

@DartBot

This comment has been minimized.

Copy link

DartBot commented Mar 2, 2012

This comment was originally written by scribe.gri...@gmail.com


After bug 1472 was fixed (and this one was created), it seems that new Date.now() returns time in UTC time zone after compiled to JS but returns local time zone in the Dartboard. Dartboard seems correct per API docs implying JS is returning the wrong TZ. Seems like this used to be correct. Should this be a new bug or can it be included in this bug?

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented Mar 4, 2012

Created Issue #1973. I need more information there, though. (Can't reproduce your bug).

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented May 4, 2012

Issue #2879 has been merged into this issue.

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented May 4, 2012

Related bug (formatting the output of Date): Issue #808.

@sethladd

This comment has been minimized.

Copy link
Member

sethladd commented Jan 21, 2013

Marked this as blocking #1728, #1728.
Unmarked this as blocking #1728.

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented Feb 26, 2013

Changed the title to: "Specify Date.parse".

@DartBot

This comment has been minimized.

Copy link

DartBot commented Apr 25, 2013

This comment was originally written by alexe.kaigorodov@gmail.com


Also, the kind of exception thrown when the argument is incorrect should be specified.

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented May 23, 2013

We should accept RFC822 and Iso 8601. If we don't accept the full ISO 8601 we should explicitly state which part.
And, of course, we should also be able to parse DateTime.toString() results (basically ISO 8601 with the "T" replace by a space).

The error should be a FormatException.


Added Ready-to-implement, PatchesWelcome labels.
Changed the title to: "Specify and extend DateTime.parse".

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented May 23, 2013

Issue #10779 has been merged into this issue.

@jmesserly

This comment has been minimized.

Copy link
Member

jmesserly commented Aug 6, 2013

another thing I noticed, DateTime.parse is missing a way to avoid the exception. it makes debugging easier ("break on all exceptions" won't pause the program constantly), and it makes code cleaner without try+catch. See "onError" in http://api.dartlang.org/docs/releases/latest/dart_core/int.html#parse and "handleError" in http://api.dartlang.org/docs/releases/latest/dart_core/double.html#parse

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented Aug 7, 2013

Agree with adding a way to handle errors.
Changing status to "Accepted".


Added Accepted label.

@lrhn

This comment has been minimized.

Copy link
Member

lrhn commented Aug 23, 2013

Removed Type-Defect label.
Added Type-Enhancement label.

@lrhn

This comment has been minimized.

Copy link
Member

lrhn commented Aug 23, 2013

Issue #3451 has been merged into this issue.

@sethladd

This comment has been minimized.

Copy link
Member

sethladd commented Aug 23, 2013

Added Docs-Requested label.

@kwalrath

This comment has been minimized.

Copy link
Member

kwalrath commented Aug 29, 2013

Removed Docs-Requested label.
Added Docs-API label.

@floitschG

This comment has been minimized.

Copy link
Contributor

floitschG commented Oct 28, 2013

Issue #14550 has been merged into this issue.

@lrhn

This comment has been minimized.

Copy link
Member

lrhn commented Apr 24, 2014

The implementation now has a grammar that it follows, it's just not reflected in the documentation yet.
There is still no onError argument to parse.

@sgjesse

This comment has been minimized.

Copy link
Member

sgjesse commented Apr 30, 2014

This issue covers the following two enhancements:

  1. Update the documentation with "some" grammar information.
  2. Add onError named optional argument.

Added this to the 1.5 milestone.

@srawlins

This comment has been minimized.

Copy link
Member

srawlins commented Nov 3, 2018

As per @sgjesse 's comment, this issue just asks that the documentation feature more specification. It does now. Additionally, a tryParse was added, handling the onError request. This issue is complete. RIP February 2012.

@srawlins srawlins closed this Nov 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment