forked from moment/moment
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use proper locale inheritance for the base locale
Previously english locale was defined mostly in Locale.prototype. Now it's moved in locale config (similar to all other locales) that is merged the same way locales are patched (updated). Fixes moment#3137
- Loading branch information
Showing
8 changed files
with
119 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { defaultCalendar } from './calendar'; | ||
import { defaultLongDateFormat } from './formats'; | ||
import { defaultInvalidDate } from './invalid'; | ||
import { defaultOrdinal, defaultOrdinalParse } from './ordinal'; | ||
import { defaultRelativeTime } from './relative'; | ||
|
||
// months | ||
import { | ||
defaultLocaleMonths, | ||
defaultLocaleMonthsShort, | ||
defaultMonthsRegex, | ||
defaultMonthsShortRegex, | ||
} from '../units/month'; | ||
|
||
// week | ||
import { defaultLocaleWeek } from '../units/week'; | ||
|
||
// weekdays | ||
import { | ||
defaultLocaleWeekdays, | ||
defaultLocaleWeekdaysMin, | ||
defaultLocaleWeekdaysShort, | ||
|
||
defaultWeekdaysRegex, | ||
defaultWeekdaysShortRegex, | ||
defaultWeekdaysMinRegex, | ||
} from '../units/day-of-week'; | ||
|
||
// meridiem | ||
import { defaultLocaleMeridiemParse } from '../units/hour'; | ||
|
||
export var baseConfig = { | ||
calendar: defaultCalendar, | ||
longDateFormat: defaultLongDateFormat, | ||
invalidDate: defaultInvalidDate, | ||
ordinal: defaultOrdinal, | ||
ordinalParse: defaultOrdinalParse, | ||
relativeTime: defaultRelativeTime, | ||
|
||
months: defaultLocaleMonths, | ||
monthsShort: defaultLocaleMonthsShort, | ||
monthsRegex: defaultMonthsRegex, | ||
monthsShortRegex: defaultMonthsShortRegex, | ||
|
||
week: defaultLocaleWeek, | ||
|
||
weekdays: defaultLocaleWeekdays, | ||
weekdaysMin: defaultLocaleWeekdaysMin, | ||
weekdaysShort: defaultLocaleWeekdaysShort, | ||
|
||
weekdaysRegex: defaultWeekdaysRegex, | ||
weekdaysShortRegex: defaultWeekdaysShortRegex, | ||
weekdaysMinRegex: defaultWeekdaysMinRegex, | ||
|
||
meridiemParse: defaultLocaleMeridiemParse | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters