Skip to content

Commit fcdbc58

Browse files
authored
fix: update en-NZ locale to use proper ordinal formatting function (#1143)
1 parent ee5a4ec commit fcdbc58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/locale/en-nz.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ const locale = {
99
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
1010
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
1111
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
12-
ordinal: n => n,
12+
ordinal: (n) => {
13+
const s = ['th', 'st', 'nd', 'rd']
14+
const v = n % 100
15+
return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`
16+
},
1317
formats: {
1418
LT: 'h:mm A',
1519
LTS: 'h:mm:ss A',

0 commit comments

Comments
 (0)