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

How should Intl.DTF formats in this proposal's locale relate to Temporal objects' toStriing() output? #7

Open
justingrant opened this issue Sep 2, 2023 · 0 comments · May be fixed by #18

Comments

@justingrant
Copy link

One way to specify the output formats of this proposal could be to leverage the fact that Temporal objects' toString output always uses ISO 8601 format which is what this proposal's locale will use too.

Should this proposal's Intl.DTF output formats be limited to what Temporal.*.prototype.toString() outputs?

This would provide the following formats:

  • 2020-12-25 - Temporal.PlainDate
  • 2020-12 - Temporal.PlainYearMonth
  • 12-25 - Temporal.PlainMonthDay
  • 2020-12-25T12:34:56 - Temporal.PlainDateTime
  • 12:34:56 - Temporal.PlainTime
  • 2020-12-25T12:34:56[America/Los_Angeles] - Temporal.ZonedDateTime
  • America/Los_Angeles - Temporal.TimeZone

Note that some Temporal toString methods have options like fractionalSecondDigits for the toString of Temporal.PlainTime and Temporal.ZonedDateTime. The AOs in the Temporal proposal that implemnt these formatting options can perhaps be leveraged for DRY purposes by this proposal's spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant