UNPKG

1.73 kBJavaScriptView Raw
1// German [de]
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',
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._Sept._Okt._Nov._Dez.'.split('_'),
34 ordinal: function ordinal(n) {
35 return n + ".";
36 },
37 weekStart: 1,
38 yearStart: 4,
39 formats: {
40 LTS: 'HH:mm:ss',
41 LT: 'HH:mm',
42 L: 'DD.MM.YYYY',
43 LL: 'D. MMMM YYYY',
44 LLL: 'D. MMMM YYYY HH:mm',
45 LLLL: 'dddd, D. MMMM YYYY HH:mm'
46 },
47 relativeTime: {
48 future: 'in %s',
49 past: 'vor %s',
50 s: relativeTimeFormatter,
51 m: relativeTimeFormatter,
52 mm: relativeTimeFormatter,
53 h: relativeTimeFormatter,
54 hh: relativeTimeFormatter,
55 d: relativeTimeFormatter,
56 dd: relativeTimeFormatter,
57 M: relativeTimeFormatter,
58 MM: relativeTimeFormatter,
59 y: relativeTimeFormatter,
60 yy: relativeTimeFormatter
61 }
62};
63dayjs.locale(locale, null, true);
64export default locale;
\No newline at end of file