зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1370086 - [DateTimePicker] Ensure calendar type is Gregorian for all locales. r=gandalf,mconley
MozReview-Commit-ID: H7kPn2bdEhP --HG-- extra : rebase_source : 0c36a0a9ea79d97375a2ebd506ec8ca880ff881d
This commit is contained in:
Родитель
e99e36dd18
Коммит
9313aeafa2
|
@ -109,7 +109,9 @@
|
|||
<method name="initPicker">
|
||||
<parameter name="detail"/>
|
||||
<body><![CDATA[
|
||||
const locale = Services.locale.getAppLocaleAsBCP47();
|
||||
// TODO: When bug 1376616 lands, replace this.setGregorian with
|
||||
// mozIntl.Locale for setting calendar to Gregorian
|
||||
const locale = this.setGregorian(Services.locale.getAppLocaleAsBCP47());
|
||||
const dir = this.mozIntl.getLocaleInfo(locale).direction;
|
||||
|
||||
switch (this.type) {
|
||||
|
@ -279,6 +281,15 @@
|
|||
return keys.map(key => displayNames.values[key]);
|
||||
]]></body>
|
||||
</method>
|
||||
<method name="setGregorian">
|
||||
<parameter name="locale"/>
|
||||
<body><![CDATA[
|
||||
if (locale.match(/u-ca-/)) {
|
||||
return locale.replace(/u-ca-[^-]+/, "u-ca-gregory");
|
||||
}
|
||||
return locale + "-u-ca-gregory";
|
||||
]]></body>
|
||||
</method>
|
||||
<method name="handleEvent">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
|
|
Загрузка…
Ссылка в новой задаче