-
-
Notifications
You must be signed in to change notification settings - Fork 35
Create option timezone as Proposed REQUIRED option
#950
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
Changes from all commits
d386fa9
3b03e17
ad3e2c9
63270de
a532a56
5bb9d1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -1103,6 +1103,10 @@ override values set by the current locale, | |||
| or provided by the _formatting context_ (such as the default time zone), | ||||
| or embedded in an implementation-defined date/time _operand_ value. | ||||
|
|
||||
| > [!NOTE] | ||||
| > These _options_ do not have default values because they are only to be used | ||||
| > as overrides for locale-and-value dependent implementation-defined defaults. | ||||
|
|
||||
| The following _option_ and its values are REQUIRED to be available on | ||||
| the functions `:datetime` and `:time`: | ||||
|
|
||||
|
|
@@ -1118,7 +1122,22 @@ the functions `:datetime`, `:date`, and `:time`. | |||
| - `numberingSystem` | ||||
| - valid [Unicode Number System Identifier](https://cldr-smoke.unicode.org/spec/main/ldml/tr35.html#UnicodeNumberSystemIdentifier) | ||||
|
|
||||
| The following _option_ and its values are **Proposed** for | ||||
| inclusion in the next release of this specification but have not yet been | ||||
| finalized. | ||||
| If accepted, implementations could be REQUIRED to make this _option_ | ||||
| available in the functions `:datetime`, `:date`, and `:time`. | ||||
|
|
||||
| - `timeZone` | ||||
| - A valid time zone identifier | ||||
| (see [TZDB](https://www.iana.org/time-zones) | ||||
| and [LDML](https://www.unicode.org/reports/tr35/tr35-dates.html#Time_Zone_Names) | ||||
| for information on identifiers) | ||||
|
Comment on lines
+1132
to
+1135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this. It's sufficiently vague to be revisable later into something more explicit, while being sufficiently specific to be unlikely to lead to abuse. |
||||
| - `local` | ||||
| - `UTC` | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I call it out for the reason JS calls it out: technically it is not a valid value and is added by exception. By listing it here, we require that all implementations accept that specific literal. All of the other literals are up to the implementation and its capabilities. |
||||
|
|
||||
| > [!NOTE] | ||||
| > These _options_ do not have default values because they are only to be used | ||||
| > as overrides for locale-and-value dependent implementation-defined defaults. | ||||
|
|
||||
| > The value `local` permits a _message_ to convert a date/time value | ||||
| > into a [floating](https://www.w3.org/TR/timezone/#floating) time value | ||||
| > (sometimes called a _plain_ or _local_ time value) by removing | ||||
| > the association with a specific time zone. | ||||
|
Comment on lines
+1140
to
+1143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find this very confusing. From the name, my presumption would be that "local" means the formatter's local system time, but that's a time with an explicit timezone, while this note is indicating that it ought to mean a datetime not associated with any timezone. With something like a literal date as operand, I presume that these would give the same results, but if the operand is an implementation-defined datetime with a timezone different from the local system time, it's not at all clear what date might get formatted. I would find it very useful to have an example provided for a use case where Also, just for clarity, are there any use cases for floating datetimes that include anything more precise than a day being formatted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't care for the name
Literals are tricky too. They get parsed into internal date/time objects. If the literal includes an offset or zone ID, then the internal type will be attached to the timeline and have an offset or zone. "Classical" time values ( The point of
Yes, all the time. Airline schedules, for example, show departure/arrival times in the local time of the airport in question. You compute the time and then float it so the digits stay the same. Of if you have a value that you want to stick to a specific time zone, it's easier to float the value than to send the time zone down the wire:
If you send If instead I just send |
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this clarification, I'm fine with merging the currently proposed text as it does not impose any restrictions or requirements on implementations, effectively kicking the can down the road.