Simplify nsDateFormatSelector enum
Categories
(Core :: Internationalization, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: dminor, Assigned: dminor)
References
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
From Bug 1426907 comment 158, some of the values for nsDateFormatSelector are no longer used or not appropriate. This bug will track removing the unused values and adding a new DateTimeFormat::GetDisplayName method for kDateFormatMonthLong
and kDateFormatWeekday
. This cleanup will help with Bug 1426907 and hopefully simplify switching over to the Rust DateTime implementation in the future.
Assignee | ||
Comment 1•4 years ago
|
||
Try run here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b6c97ffdc0ed027b7b2f7f51a6e3b4e66d93f167
Assignee | ||
Comment 2•4 years ago
|
||
This adds a method to get the display name for a month or a weekday in long or
short form. We'll add more fields and styles in the future, the current patch
provides enough functionality to replace the selectors for kDateFormatMonthLong
and kDateFormatWeekday, which are currently used to retrieve display names by
calling FormatPRExplodedTime.
Assignee | ||
Comment 3•4 years ago
|
||
The formatters in mFormatCache are only valid for the locale in which they were
created. Currently the tests change mLocale directly but leave the cache in
place which can lead to incorrect test results depending upon which tests are
executed. This is not a problem outside of the tests because mLocale is normally
only set once during the call to Initialize() which will not change the current
locale once it is set.
Depends on D93008
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D93009
Assignee | ||
Comment 5•4 years ago
|
||
This renames kTimeFormatSeconds to kTimeFormatLong and kTimeFormatNoSeconds to
kTimeFormatShort. This is consistent with the naming used for date format
selectors.
Depends on D93010
Assignee | ||
Comment 6•4 years ago
|
||
This adds a FormatDateTime method that takes a skeleton as an argument and
returns the localized date and time according to the skeleton. In the future,
we'll add an overload that allows taking an DateTimeOptions property bag, but
for now, this will provide enough functionality to allow us to remove the
kDateFormatYearMonth and kDateFormatYearMonthLong selectors as well as the code
for handling skeletons from FormatPRExplodedTime.
Depends on D93011
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D93012
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9230f50a236e Add DataTimeFormat::GetCalendarSymbol; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/2d91e316f450 Call DeleteCache when changing locale in TestDateTimeFormat; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/f2800056f310 Replace kDateFormatMonthLong/kDateFormatWeekday with GetCalendarSymbol; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/0fac34686721 Rename kTimeFormatSeconds and kTimeFormatNoSeconds; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/9e44a2c80df2 Add DataTimeFormat::FormatDateTime; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/0f1220aeaf17 Replace kDateFormatYearMonth/kDateFormatYearMonthLong with FormatDateTime; r=zbraniecki
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9230f50a236e
https://hg.mozilla.org/mozilla-central/rev/2d91e316f450
https://hg.mozilla.org/mozilla-central/rev/f2800056f310
https://hg.mozilla.org/mozilla-central/rev/0fac34686721
https://hg.mozilla.org/mozilla-central/rev/9e44a2c80df2
https://hg.mozilla.org/mozilla-central/rev/0f1220aeaf17
Comment 11•3 years ago
|
||
Just for the record: kDateFormatWeekday was used in Thunderbird and had especially been restored in bug 1329841 after being removed for the first time when switching to ICU earlier on. Now Thunderbird filed bug 1672548 to restore that formatting.
Description
•