Skip to content

Commit 1b95ecd

Browse files
fix: [en-AU] locale use the same ordinal as moment (#2878)
The en-AU locale wasn't using ordinal at all. It should follow the same as the other English languages. Co-authored-by: iamkun <[email protected]>
1 parent 5465380 commit 1b95ecd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/locale/en-au.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ 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,
1312
formats: {
1413
LT: 'h:mm A',
1514
LTS: 'h:mm:ss A',
@@ -32,6 +31,11 @@ const locale = {
3231
MM: '%d months',
3332
y: 'a year',
3433
yy: '%d years'
34+
},
35+
ordinal: (n) => {
36+
const s = ['th', 'st', 'nd', 'rd']
37+
const v = n % 100
38+
return `[${n}${(s[(v - 20) % 10] || s[v] || s[0])}]`
3539
}
3640
}
3741

0 commit comments

Comments
 (0)