Navigation Menu

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

Specify and extend DateTime.parse #1878

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

Specify and extend DateTime.parse #1878

floitschG opened this issue Feb 27, 2012 · 20 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-2 library-core P2 A bug or feature request we're likely to work on type-documentation A request to add or improve documentation

Comments

@floitschG
Copy link
Contributor

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

@floitschG
Copy link
Contributor Author

Marked this as blocking #1728.

@DartBot
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
Copy link
Contributor Author

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

@floitschG
Copy link
Contributor Author

Issue #2879 has been merged into this issue.

@floitschG
Copy link
Contributor Author

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

@sethladd
Copy link
Contributor

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

@floitschG
Copy link
Contributor Author

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

@DartBot
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
Copy link
Contributor Author

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
Copy link
Contributor Author

Issue #10779 has been merged into this issue.

@jmesserly
Copy link

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
Copy link
Contributor Author

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


Added Accepted label.

@lrhn
Copy link
Member

lrhn commented Aug 23, 2013

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

@lrhn
Copy link
Member

lrhn commented Aug 23, 2013

Issue #3451 has been merged into this issue.

@sethladd
Copy link
Contributor

Added Docs-Requested label.

@kwalrath
Copy link
Contributor

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

@floitschG
Copy link
Contributor Author

Issue #14550 has been merged into this issue.

@lrhn
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
Copy link
Contributor

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
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 as completed Nov 3, 2018
copybara-service bot pushed a commit that referenced this issue Jan 31, 2023
…g, mockito, package_config, shelf, string_scanner, test, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (https://github.com/dart-lang/async/compare/f700e9a..f700e9a):
  f700e9a  2023-01-27  Devon Carew  blast_repo fixes (#231)

characters (https://github.com/dart-lang/characters/compare/4526aa8..4526aa8):
  4526aa8  2023-01-30  Lasse R.H. Nielsen  Update tables to Unicode 15.0. (#71)

collection (https://github.com/dart-lang/collection/compare/a566328..a566328):
  a566328  2023-01-26  Devon Carew  add a publish script; prep to publish (#267)

dartdoc (https://github.com/dart-lang/dartdoc/compare/bc7bdc4..bc7bdc4):
  bc7bdc44  2023-01-30  dependabot[bot]  Bump js from 0.6.5 to 0.6.7 (#3310)

json_rpc_2 (https://github.com/dart-lang/json_rpc_2/compare/e73c4ad..e73c4ad):
  e73c4ad  2023-01-26  Devon Carew  blast_repo fixes (#89)

logging (https://github.com/dart-lang/logging/compare/399100a..399100a):
  399100a  2023-01-26  Devon Carew  add a publish script; prep to publish 1.1.1 (#128)

mockito (https://github.com/dart-lang/mockito/compare/d2a8df1..d2a8df1):
  d2a8df1  2023-01-30  Kevin Moore  Latest build_web_compilers, move to pkg:lints, fix breaks (#605)
  13340b5  2023-01-30  dependabot[bot]  Bump dart-lang/setup-dart from 1.3 to 1.4 (#600)

package_config (https://github.com/dart-lang/package_config/compare/3fe81c4..3fe81c4):
  3fe81c4  2023-01-30  Kevin Moore  Support latest pkg:build_web_compilers, lints. Update min SDK (#129)

shelf (https://github.com/dart-lang/shelf/compare/8fca9d9..8fca9d9):
  8fca9d9  2023-01-26  Devon Carew  blast_repo fixes (#326)

string_scanner (https://github.com/dart-lang/string_scanner/compare/29e471e..29e471e):
  29e471e  2023-01-30  dependabot[bot]  Bump dart-lang/setup-dart from 1.3 to 1.4 (#53)

test (https://github.com/dart-lang/test/compare/cec47c1..cec47c1):
  cec47c1c  2023-01-27  Nate Bosch  Add missing pub requirements (#1878)
  c99d455e  2023-01-27  Nate Bosch  Prepare to publish (#1877)
  0e7ec6a7  2023-01-27  Nate Bosch  Rename `Check` to `Subject` (#1875)
  78382731  2023-01-27  Nate Bosch  Add String.matches condition (#1874)
  26e0e87b  2023-01-27  Nate Bosch  Add Iterable.containsInOrder condition (#1873)
  c9232d6b  2023-01-27  Nate Bosch  Rename `that` to `which` (#1872)
  457166b3  2023-01-26  Nate Bosch  Add missing dependency on package:lints (#1876)
  193f2a0b  2023-01-26  Nate Bosch  Retry instead of extend timeout for flaky Node tests (#1871)
  7ad9b2c3  2023-01-26  Nate Bosch  Overhaul async matchers (#1868)
  ca254546  2023-01-26  Nate Bosch  Add a withQueue utility (#1870)
  6ae2e5e9  2023-01-26  Nate Bosch  Refactor tests to a new isRejectedBy utility (#1867)
  5aeba66d  2023-01-26  Nate Bosch  Use pubspec_overrides.yaml files (#1869)

webdev (https://github.com/dart-lang/webdev/compare/ce9c581..ce9c581):
  ce9c581  2023-01-29  Anna Gringauze  Validate only needed summaries in expression_compiler_service (#1920)

Change-Id: I3ddb0ddeb3b989f6f9e78cd8aa6327aba5899018
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280078
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-2 library-core P2 A bug or feature request we're likely to work on type-documentation A request to add or improve documentation
Projects
None yet
Development

No branches or pull requests

10 participants