Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix uk locale abbreviated months matcher (#3139)
Fixed `uk` locale abbreviated months matcher.
- Loading branch information
Showing
3 changed files
with
443 additions
and
223 deletions.
There are no files selected for viewing
98 changes: 59 additions & 39 deletions
98
scripts/build/localeSnapshots/renderFormatParse/formatParseTokens.js
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 |
---|---|---|
@@ -1,218 +1,238 @@ | ||
const yearDates = [ | ||
new Date(1987, 1, 11, 12, 13, 14, 15), | ||
new Date(0, 0, 1, 12, 13, 14, 15).setFullYear(5, 0, 1) | ||
new Date(0, 0, 1, 12, 13, 14, 15).setFullYear(5, 0, 1), | ||
] | ||
|
||
const quarterDates = [ | ||
new Date(2019, 0, 1, 12, 13, 14, 15), | ||
new Date(2019, 3, 1, 12, 13, 14, 15) | ||
new Date(2019, 3, 1, 12, 13, 14, 15), | ||
] | ||
|
||
const monthDates = [ | ||
new Date(2019, 0, 11, 12, 13, 14, 15), | ||
new Date(2019, 1, 11, 12, 13, 14, 15), | ||
new Date(2019, 6, 10, 12, 13, 14, 15) | ||
new Date(2019, 2, 11, 12, 13, 14, 15), | ||
new Date(2019, 3, 10, 12, 13, 14, 15), | ||
new Date(2019, 4, 10, 12, 13, 14, 15), | ||
new Date(2019, 5, 10, 12, 13, 14, 15), | ||
new Date(2019, 6, 10, 12, 13, 14, 15), | ||
new Date(2019, 7, 10, 12, 13, 14, 15), | ||
new Date(2019, 8, 10, 12, 13, 14, 15), | ||
new Date(2019, 9, 10, 12, 13, 14, 15), | ||
new Date(2019, 10, 10, 12, 13, 14, 15), | ||
new Date(2019, 11, 10, 12, 13, 14, 15), | ||
] | ||
|
||
const weekOfYearDates = [ | ||
new Date(2019, 0, 1, 12, 13, 14, 15), | ||
new Date(2019, 11, 1, 12, 13, 14, 15) | ||
new Date(2019, 11, 1, 12, 13, 14, 15), | ||
] | ||
|
||
const dayOfMonthDates = [ | ||
new Date(2019, 1, 11, 12, 13, 14, 15), | ||
new Date(2019, 1, 28, 12, 13, 14, 15) | ||
new Date(2019, 1, 28, 12, 13, 14, 15), | ||
] | ||
|
||
const dayOfYearDates = [ | ||
new Date(2019, 1, 11, 12, 13, 14, 15), | ||
new Date(2019, 11, 31, 12, 13, 14, 15) | ||
new Date(2019, 11, 31, 12, 13, 14, 15), | ||
] | ||
|
||
const dayOfWeekDates = [ | ||
new Date(2019, 1, 11, 12, 13, 14, 15), | ||
new Date(2019, 1, 15, 12, 13, 14, 15) | ||
new Date(2019, 1, 15, 12, 13, 14, 15), | ||
] | ||
|
||
const timeOfDayDates = [ | ||
new Date(2019, 1, 11, 11, 13, 14, 15), | ||
new Date(2019, 1, 11, 14, 13, 14, 15), | ||
new Date(2019, 1, 11, 19, 13, 14, 15), | ||
new Date(2019, 1, 11, 2, 13, 14, 15) | ||
new Date(2019, 1, 11, 2, 13, 14, 15), | ||
] | ||
|
||
const hourDates = [ | ||
new Date(2019, 1, 11, 11, 13, 14, 15), | ||
new Date(2019, 1, 11, 23, 13, 14, 15) | ||
new Date(2019, 1, 11, 23, 13, 14, 15), | ||
] | ||
|
||
const localizedDates = [ | ||
new Date(1987, 0, 11, 12, 13, 14, 15), | ||
new Date(1987, 1, 11, 12, 13, 14, 15), | ||
new Date(1453, 4, 29, 23, 59, 59, 999) | ||
new Date(1987, 2, 11, 12, 13, 14, 15), | ||
new Date(1987, 3, 11, 12, 13, 14, 15), | ||
new Date(1453, 4, 29, 23, 59, 59, 999), | ||
new Date(1987, 5, 11, 12, 13, 14, 15), | ||
new Date(1987, 6, 11, 12, 13, 14, 15), | ||
new Date(1987, 7, 11, 12, 13, 14, 15), | ||
new Date(1987, 8, 11, 12, 13, 14, 15), | ||
new Date(1987, 9, 11, 12, 13, 14, 15), | ||
new Date(1987, 10, 11, 12, 13, 14, 15), | ||
new Date(1987, 11, 11, 12, 13, 14, 15), | ||
] | ||
|
||
const formatParseTokens = [ | ||
{ | ||
title: 'Calendar year', | ||
tokens: ['yo'], | ||
dates: yearDates | ||
dates: yearDates, | ||
}, | ||
|
||
{ | ||
title: 'Local week-numbering year', | ||
tokens: ['Yo'], | ||
dates: yearDates, | ||
options: { useAdditionalWeekYearTokens: true } | ||
options: { useAdditionalWeekYearTokens: true }, | ||
}, | ||
|
||
{ | ||
title: 'Quarter (formatting)', | ||
tokens: ['Qo', 'QQQ', 'QQQQ', 'QQQQQ'], | ||
dates: quarterDates | ||
dates: quarterDates, | ||
}, | ||
|
||
{ | ||
title: 'Quarter (stand-alone)', | ||
tokens: ['qo', 'qqq', 'qqqq'], | ||
dates: quarterDates | ||
dates: quarterDates, | ||
}, | ||
|
||
{ | ||
title: 'Month (formatting)', | ||
tokens: ['Mo', 'MMM', 'MMMM', 'MMMMM'], | ||
dates: monthDates | ||
dates: monthDates, | ||
}, | ||
|
||
{ | ||
title: 'Month (stand-alone) ', | ||
tokens: ['Lo', 'LLL', 'LLLL', 'LLLLL'], | ||
dates: monthDates | ||
dates: monthDates, | ||
}, | ||
|
||
{ | ||
title: 'Local week of year', | ||
tokens: ['wo'], | ||
dates: weekOfYearDates | ||
dates: weekOfYearDates, | ||
}, | ||
|
||
{ | ||
title: 'ISO week of year', | ||
tokens: ['Io'], | ||
dates: weekOfYearDates | ||
dates: weekOfYearDates, | ||
}, | ||
|
||
{ | ||
title: 'Day of month', | ||
tokens: ['do'], | ||
dates: dayOfMonthDates | ||
dates: dayOfMonthDates, | ||
}, | ||
|
||
{ | ||
title: 'Day of year', | ||
tokens: ['Do'], | ||
dates: dayOfYearDates, | ||
options: { useAdditionalDayOfYearTokens: true } | ||
options: { useAdditionalDayOfYearTokens: true }, | ||
}, | ||
|
||
{ | ||
title: 'Day of week (formatting)', | ||
tokens: ['E', 'EE', 'EEE', 'EEEE', 'EEEEE', 'EEEEEE'], | ||
dates: dayOfWeekDates | ||
dates: dayOfWeekDates, | ||
}, | ||
|
||
{ | ||
title: 'ISO day of week (formatting)', | ||
tokens: ['io', 'iii', 'iiii', 'iiiii', 'iiiiii'], | ||
dates: dayOfWeekDates | ||
dates: dayOfWeekDates, | ||
}, | ||
|
||
{ | ||
title: 'Local day of week (formatting)', | ||
tokens: ['eo', 'eee', 'eeee', 'eeeee', 'eeeeee'], | ||
dates: dayOfWeekDates | ||
dates: dayOfWeekDates, | ||
}, | ||
|
||
{ | ||
title: 'Local day of week (stand-alone)', | ||
tokens: ['co', 'ccc', 'cccc', 'ccccc', 'cccccc'], | ||
dates: dayOfWeekDates | ||
dates: dayOfWeekDates, | ||
}, | ||
|
||
{ | ||
title: 'AM, PM', | ||
tokens: ['a', 'aa', 'aaa', 'aaaa', 'aaaaa'], | ||
dates: timeOfDayDates | ||
dates: timeOfDayDates, | ||
}, | ||
|
||
{ | ||
title: 'AM, PM, noon, midnight', | ||
tokens: ['b', 'bb', 'bbb', 'bbbb', 'bbbbb'], | ||
dates: timeOfDayDates | ||
dates: timeOfDayDates, | ||
}, | ||
|
||
{ | ||
title: 'Flexible day period', | ||
tokens: ['B', 'BB', 'BBB', 'BBBB', 'BBBBB'], | ||
dates: timeOfDayDates | ||
dates: timeOfDayDates, | ||
}, | ||
|
||
{ | ||
title: 'Hour [1-12]', | ||
tokens: ['ho'], | ||
dates: hourDates | ||
dates: hourDates, | ||
}, | ||
|
||
{ | ||
title: 'Hour [0-23]', | ||
tokens: ['Ho'], | ||
dates: hourDates | ||
dates: hourDates, | ||
}, | ||
|
||
{ | ||
title: 'Hour [0-11]', | ||
tokens: ['Ko'], | ||
dates: hourDates | ||
dates: hourDates, | ||
}, | ||
|
||
{ | ||
title: 'Hour [1-24]', | ||
tokens: ['ko'], | ||
dates: hourDates | ||
dates: hourDates, | ||
}, | ||
|
||
{ | ||
title: 'Minute', | ||
tokens: ['mo'], | ||
dates: [ | ||
new Date(2019, 0, 1, 12, 1, 14, 15), | ||
new Date(2019, 3, 1, 12, 55, 14, 15) | ||
] | ||
new Date(2019, 3, 1, 12, 55, 14, 15), | ||
], | ||
}, | ||
|
||
{ | ||
title: 'Second', | ||
tokens: ['so'], | ||
dates: [ | ||
new Date(2019, 0, 1, 12, 13, 1, 15), | ||
new Date(2019, 3, 1, 12, 13, 55, 15) | ||
] | ||
new Date(2019, 3, 1, 12, 13, 55, 15), | ||
], | ||
}, | ||
|
||
{ | ||
title: 'Long localized date', | ||
tokens: ['P', 'PP', 'PPP', 'PPPP'], | ||
dates: localizedDates | ||
dates: localizedDates, | ||
}, | ||
|
||
{ | ||
title: 'Long localized time', | ||
tokens: ['p', 'pp', 'ppp', 'pppp'], | ||
dates: localizedDates | ||
dates: localizedDates, | ||
}, | ||
|
||
{ | ||
title: 'Combination of date and time', | ||
tokens: ['Pp', 'PPpp', 'PPPppp', 'PPPPpppp'], | ||
dates: localizedDates | ||
} | ||
dates: localizedDates, | ||
}, | ||
] | ||
export default formatParseTokens |
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
Oops, something went wrong.