-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 5 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,13 +1103,35 @@ 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`: | ||||
|
||||
- `hour12` | ||||
- `true` | ||||
- `false` | ||||
|
||||
The following _option_ and its values will be REQUIRED to be available on | ||||
the functions `:datetime`, `:date`, and `:time`. | ||||
This option currently has a Maturity Level of **Proposed**. | ||||
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. We can't use a term in the spec that's only documented in a proposed design document. 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. The point of that particular design document is to address maintenance of the I can remove this line. A better course of action would be to add a legend to the top of registry.md that says what the maturity levels are. Probably the only maturity levels that should show are "Proposed" and "Deprecated" ("Accepted" applies to a proposal that hasn't been released yet, i.e. you're not reading it). 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. Until/unless we have an internal reference for what "Proposed" means, this statement ought to be replaced with text that describes its relevant effects on 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. Fair enough. I will replace this with text that describes the specific status. |
||||
|
||||
- `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] | ||||
> 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 |
||||
|
||||
The following _options_ and their values are RECOMMENDED to be available on | ||||
the functions `:datetime`, `:date`, and `:time`. | ||||
|
||||
|
@@ -1118,7 +1140,4 @@ the functions `:datetime`, `:date`, and `:time`. | |||
- `numberingSystem` | ||||
- valid [Unicode Number System Identifier](https://cldr-smoke.unicode.org/spec/main/ldml/tr35.html#UnicodeNumberSystemIdentifier) | ||||
|
||||
> [!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. | ||||
|
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.
This ought to be RECOMMENDED.
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.
What's the reason to make this option merely recommended?
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.
It introduces a dependency on timezone data. Without the option, a
:datetime
formatter doesn't need to know how timezones work, as it can "just" format the input values. With the option, the formatter is expected to know how timezones relate to each other, and when e.g. daylight savings changes happen.This is particularly relevant as the formatted output often does not include a timezone indicator.
I'm concerned here about the bar we're setting for a minimal valid MF2 implementation, which I don't want to burden with timezone data, esp. given how frequently and unpredictably it changes. Marking this as RECOMMENDED would give a signal to implementers and users that this should not be relied on without checking the capabilities of the MF2 implementation.
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.
I don't agree that there is a dependency on timezone data. This provides a way for users to manage time zone in messages, but does not promise that the implementation can effectively use it.
It definitely does not require that implementations have to be au courant with TZDB. Also, minimalistic implementations or languages usually depend on operating system patches rather than their own copy of the data. Unsupported Operation is an option for truly bereft platforms.
In any case, it is impossible to implement a date/time formatter of any stripe without at least the knowledge of zone offsets. Otherwise every time is a floating time and/or expressed as UTC. For incremental times [like JS
Date
and similar], this is only great if you live in West Africa or Iceland.Finally, notice that JS started its timezone adventure with just
UTC
and "local" as required. The design here is deliberately similar. If one's platform doesn't support real time zones, one's platform is probably being foolish. But we don't require such support even if we are requiringtimeZone
as an option.