Skip to content

Commit 4da01dc

Browse files
authored
Add hour12 date/time override option (#948)
1 parent ba754d3 commit 4da01dc

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

spec/registry.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,10 @@ All other _operand_ values produce a _Bad Operand_ error.
857857
The `:datetime` function can use either the appropriate _style options_
858858
or can use a collection of _field options_ (but not both) to control the formatted
859859
output.
860+
_Date/time override options_ can be combined with either _style options_ or _field options_.
860861

861-
If both are specified, a _Bad Option_ error MUST be emitted
862+
If both _style options_ and _field options_ are specified,
863+
a _Bad Option_ error is emitted
862864
and a _fallback value_ used as the _resolved value_ of the _expression_.
863865

864866
If the _operand_ of the _expression_ is an implementation-defined date/time type,
@@ -897,7 +899,7 @@ and what format to use for that field.
897899
The _field options_ are defined as follows:
898900

899901
> [!IMPORTANT]
900-
> The value `2-digit` for some _field options_ **must** be quoted
902+
> The value `2-digit` for some _field options_ MUST be quoted
901903
> in the MessageFormat syntax because it starts with a digit
902904
> but does not match the `number-literal` production in the ABNF.
903905
> ```
@@ -939,11 +941,6 @@ The function `:datetime` has the following options:
939941
- `1`
940942
- `2`
941943
- `3`
942-
- `hourCycle` (default is locale-specific)
943-
- `h11`
944-
- `h12`
945-
- `h23`
946-
- `h24`
947944
- `timeZoneName`
948945
- `long`
949946
- `short`
@@ -995,6 +992,7 @@ The function `:date` has these _options_:
995992
- `long`
996993
- `medium` (default)
997994
- `short`
995+
- _Date/time override options_
998996
999997
If the _operand_ of the _expression_ is an implementation-defined date/time type,
1000998
it can include other option values.
@@ -1032,6 +1030,7 @@ The function `:time` has these _options_:
10321030
- `long`
10331031
- `medium`
10341032
- `short` (default)
1033+
- _Date/time override options_
10351034
10361035
If the _operand_ of the _expression_ is an implementation-defined date/time type,
10371036
it can include other option values.
@@ -1095,3 +1094,21 @@ For more information, see [Working with Timezones](https://w3c.github.io/timezon
10951094
> The form of these serializations is known and is a de facto standard.
10961095
> Support for these extensions is expected to be required in the post-tech preview.
10971096
> See: https://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/
1097+
1098+
### Date and Time Override Options
1099+
1100+
**_<dfn>Date/time override options</dfn>_** are _options_ that allow an _expression_ to
1101+
override values set by the current locale,
1102+
or provided by the _formatting context_ (such as the default time zone),
1103+
or embedded in an implementation-defined date/time _operand_ value.
1104+
1105+
The following REQUIRED option and its values MUST be available on
1106+
the functions `:datetime` and `:time`:
1107+
1108+
- `hour12`
1109+
- `true`
1110+
- `false`
1111+
1112+
> [!NOTE]
1113+
> These options do not have default values because they are only to be used
1114+
> as overrides for locale-and-value dependent implementation-defined defaults.

0 commit comments

Comments
 (0)