Implement dateStyle and timeStyle option on Intl.DateTimeFormat
Categories
(Core :: JavaScript: Internationalization API, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: alex.fdm, Assigned: anba)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, parity-chrome)
Attachments
(5 files)
The specification is already on Stage 3: https://github.com/tc39/proposal-intl-datetime-style
There was a previous implementation of these on bug #1329904, but it does not seem to follow the current spec.
Updated•6 years ago
|
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Btw. this is already implemented in SpiderMonkey for internal use (bug 1329904) - in fact the ECMA402 proposal has been kicked off by us to expose that.
So this should mostly be about exposing already existing bits to public.
Assignee | ||
Comment 2•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
mozExtensions
is now only used for the patternOption
property, because
dateStyle
and timeStyle
are no longer custom extensions. So instead of
testing for mozExtensions
, we can simply only test if patternOptions
is
present.
And update Intl_DateTimeFormat_resolvedOptions
to only set the "hour12"
and "hourCycle" options when timeStyle
is used.
Depends on D73892
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D73894
Assignee | ||
Comment 5•5 years ago
|
||
CLDR provides date-time patterns, not skeletons, for date/time-styles, so
when either hour12
or hourCycle
is present, we need to adjust the returned
pattern to use the correct hour symbol.
Drive-by change:
- Move
replaceHourRepresentation
for standard options to C++. - Change
resolveDateTimeFormatInternals
to no longer change the hour
symbol when the non-standardpatternOption
is used.
Depends on D73895
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D73896
Comment 8•5 years ago
|
||
Backed out 5 changesets for causing bustages in DateTimeFormat.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/dab3c58da8d2202fbacdf818e53503e1ac9d5a68
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=305830727&repo=autoland&lineNumber=17103
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/728f07ec3003
https://hg.mozilla.org/mozilla-central/rev/4a973d7cbca2
https://hg.mozilla.org/mozilla-central/rev/dd064bac3143
https://hg.mozilla.org/mozilla-central/rev/f0a7e9cdc27c
https://hg.mozilla.org/mozilla-central/rev/ecc73e9b85b1
Comment 11•5 years ago
|
||
Release notes announcement:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/79#JavaScript
Reference docs now mention the new constructor options:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat
Compat data:
https://github.com/mdn/browser-compat-data/pull/6358
Let me know if you have any feedback.
Assignee | ||
Comment 12•5 years ago
|
||
(In reply to Florian Scholz [:fscholz] (MDN) from comment #11)
Let me know if you have any feedback.
LGTM. Thanks!
Description
•