-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 and Number formatting #808
Comments
Removed Area-Editor label. |
This comment was originally written by @butlermatt I'm particularly interested in Date formatting convenience function(s). Even an optional argument of Date.toString to accept formatted string arguments (ie: %Y-%m %h:%m) and other such notations. That or alternatively add a .fmtString(String format) method instead of an optional argument to toString. This is surprising it doesn't support it, as a new Date instance can be created from a formatted string, but not able to generate a formatted string itself. |
I think I changed the Date class to only accept (a subset) of Iso 8601, which is consistent with its output (which, again, is very close to Iso 8601). From my point-of-view the only requirement for the Date.fromString should be to accept the output of Date.toString. Date-strings are just extremely locale dependent and getting Date parsing right would be difficult. I would not be surprised if the same string should be interpreted differently depending on where you are. For instance some countries prefer months first, whereas other the days, etc. The current idea is to leave more complex date-formatting (and parsing) to an i18n library |
Small correction: Date.fromString should also be able to parse Iso 8601 (in addition to Date.toString). |
Date.fromString is tracked in issue #1878. |
Date formating (date to string) is tracked in issue #1706. |
Thank you for the report. I am closing this specific issue as it covers two broad issues, with at least one having an open issue. Note: this does not mean we are not doing this, just that we need two specific issues to track. Added WontFix label. |
… shelf, tools, vector_math, webdev, yaml_edit Revisions updated by `dart tools/rev_sdk_deps.dart`. args (https://github.com/dart-lang/args/compare/9305d5a..7a5e3b0): 7a5e3b0 2023-03-14 Devon Carew update readme; add contributing doc (#237) benchmark_harness (https://github.com/dart-lang/benchmark_harness/compare/a6a0891..725534a): 725534a 2023-03-14 Kevin Moore Spelling fixes, latest lints, move to minilibs (drop parts) (#85) clock (https://github.com/dart-lang/clock/compare/5abb481..984642e): 984642e 2023-03-15 Kevin Moore Require Dart 2.19, use and fix recommended lints (#46) csslib (https://github.com/dart-lang/csslib/compare/b671738..d32bdd4): d32bdd4 2023-03-14 Devon Carew refactor the package example (#170) dartdoc (https://github.com/dart-lang/dartdoc/compare/98fa859..7fde7a4): 7fde7a4d 2023-03-13 dependabot[bot] Bump github/codeql-action from 2.2.5 to 2.2.6 (#3363) protobuf (https://github.com/dart-lang/protobuf/compare/75bc380..b90a4c4): b90a4c4 2023-03-16 Mahdi K. Fard Sort message constructors first. (#807) 00fd975 2023-03-15 Kevin Moore Fix formatting with latest SDK (#808) a67bbb3 2023-03-15 dependabot[bot] Bump actions/cache from 3.2.4 to 3.2.6 (#804) shelf (https://github.com/dart-lang/shelf/compare/e3cfe79..9a792b4): 9a792b4 2023-03-13 Kevin Moore Update format for latest v3 SDK (#340) c8094b7 2023-03-13 Kevin Moore Update no-response.yml - once a day (#339) tools (https://github.com/dart-lang/tools/compare/e5353aa..8d18d01): 8d18d01 2023-03-15 Elias Yishak Implement fake ga client (#37) vector_math (https://github.com/google/vector_math.dart/compare/1e4d000..7dec984): 7dec984 2023-03-16 eoineoineoin Add operator== to Quaternion (#288) webdev (https://github.com/dart-lang/webdev/compare/cfe9753..c2c8b17): c2c8b17 2023-03-16 Elliott Brooks (she/her) Prepare Webdev version `3.0.2` for release (#2037) d124fa5 2023-03-16 Elliott Brooks (she/her) Prepare extension for release (#2036) aef715d 2023-03-15 Elliott Brooks (she/her) Prepare DWDS 18.0.1 for release (#2035) a15fde0 2023-03-15 Anna Gringauze fix matching record types (#2032) 05031da 2023-03-14 Anna Gringauze Update build_daemon constraint and log errors (#2029) 49013b8 2023-03-09 Elliott Brooks (she/her) [MV3 Debug Extension] Fix authentication issue for the Dart Debug Extension (#2026) c8d4439 2023-03-09 Elliott Brooks (she/her) Support `Set` inspection in DWDS (#2024) 442639d 2023-03-08 Elliott Brooks (she/her) Handle unexpected extension debugger disconnection events without crashing app (#2021) yaml_edit (https://github.com/dart-lang/yaml_edit/compare/6abc42a..fbc5cb3): fbc5cb3 2023-03-09 Kevin Moore Require Dart 2.19, update to latest lints c9e82f0 2023-03-09 Mohamed Ishad Fix YamlEditor.update method leaving trailing spaces at eol (#42) Change-Id: Icf15fc0ffd3ee36e0380751d18fd491de071040e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289881 Auto-Submit: Devon Carew <devoncarew@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Editor Feedback:
Please add date and number string formatting. This feature is a real world requirements.
The text was updated successfully, but these errors were encountered: