Skip to content

Commit 508c3a7

Browse files
tcrandsiamkun
authored andcommitted
fix: Add en-gb locale (#478)
1 parent a4cbf1d commit 508c3a7

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/locale/en-gb.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import dayjs from 'dayjs'
2+
3+
const locale = {
4+
name: 'en-gb',
5+
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
6+
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
7+
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
8+
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
9+
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
10+
weekStart: 1,
11+
relativeTime: {
12+
future: 'in %s',
13+
past: '%s ago',
14+
s: 'a few seconds',
15+
m: 'a minute',
16+
mm: '%d minutes',
17+
h: 'an hour',
18+
hh: '%d hours',
19+
d: 'a day',
20+
dd: '%d days',
21+
M: 'a month',
22+
MM: '%d months',
23+
y: 'a year',
24+
yy: '%d years'
25+
},
26+
formats: {
27+
LT: 'HH:mm',
28+
LTS: 'HH:mm:ss',
29+
L: 'DD/MM/YYYY',
30+
LL: 'D MMMM YYYY',
31+
LLL: 'D MMMM YYYY HH:mm',
32+
LLLL: 'dddd, D MMMM YYYY HH:mm'
33+
},
34+
ordinal: (n) => {
35+
const s = ['th', 'st', 'nd', 'rd']
36+
const v = n % 100
37+
return `[${n}${(s[(v - 20) % 10] || s[v] || s[0])}]`
38+
}
39+
}
40+
41+
dayjs.locale(locale, null, true)
42+
43+
export default locale

0 commit comments

Comments
 (0)