UNPKG

1.72 kBJavaScriptView Raw
1// German (Switzerland) [de-ch]
2import dayjs from '../index';
3var texts = {
4 s: 'ein paar Sekunden',
5 m: ['eine Minute', 'einer Minute'],
6 mm: '%d Minuten',
7 h: ['eine Stunde', 'einer Stunde'],
8 hh: '%d Stunden',
9 d: ['ein Tag', 'einem Tag'],
10 dd: ['%d Tage', '%d Tagen'],
11 M: ['ein Monat', 'einem Monat'],
12 MM: ['%d Monate', '%d Monaten'],
13 y: ['ein Jahr', 'einem Jahr'],
14 yy: ['%d Jahre', '%d Jahren']
15};
16
17function relativeTimeFormatter(number, withoutSuffix, key) {
18 var l = texts[key];
19
20 if (Array.isArray(l)) {
21 l = l[withoutSuffix ? 0 : 1];
22 }
23
24 return l.replace('%d', number);
25}
26
27var locale = {
28 name: 'de-ch',
29 weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
30 weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
31 weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
32 months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
33 monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
34 ordinal: function ordinal(n) {
35 return n + ".";
36 },
37 weekStart: 1,
38 formats: {
39 LT: 'HH:mm',
40 LTS: 'HH:mm:ss',
41 L: 'DD.MM.YYYY',
42 LL: 'D. MMMM YYYY',
43 LLL: 'D. MMMM YYYY HH:mm',
44 LLLL: 'dddd, D. MMMM YYYY HH:mm'
45 },
46 relativeTime: {
47 future: 'in %s',
48 past: 'vor %s',
49 s: relativeTimeFormatter,
50 m: relativeTimeFormatter,
51 mm: relativeTimeFormatter,
52 h: relativeTimeFormatter,
53 hh: relativeTimeFormatter,
54 d: relativeTimeFormatter,
55 dd: relativeTimeFormatter,
56 M: relativeTimeFormatter,
57 MM: relativeTimeFormatter,
58 y: relativeTimeFormatter,
59 yy: relativeTimeFormatter
60 }
61};
62dayjs.locale(locale, null, true);
63export default locale;
\No newline at end of file