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

Date and Number formatting #808

Closed
keertip opened this issue Dec 12, 2011 · 7 comments
Closed

Date and Number formatting #808

keertip opened this issue Dec 12, 2011 · 7 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug

Comments

@keertip
Copy link
Contributor

keertip commented Dec 12, 2011

Editor Feedback:

Please add date and number string formatting. This feature is a real world requirements.

@bwilkerson
Copy link
Member

Removed Area-Editor label.
Added Area-Library label.

@DartBot
Copy link

DartBot commented May 3, 2012

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.

@floitschG
Copy link
Contributor

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

@floitschG
Copy link
Contributor

Small correction: Date.fromString should also be able to parse Iso 8601 (in addition to Date.toString).

@floitschG
Copy link
Contributor

Date.fromString is tracked in issue #1878.

@sethladd
Copy link
Contributor

Date formating (date to string) is tracked in issue #1706.

@sethladd
Copy link
Contributor

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.

@keertip keertip added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels May 16, 2012
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug and removed resolution-wont_fix labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Mar 20, 2023
… 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 <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
This issue was closed.
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. closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants