1 // moment.js locale configuration
2 // locale : Luxembourgish (lb)
3 // author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz
5 // Note: Luxembourgish has a very particular phonological rule ('Eifeler Regel') that causes the
6 // deletion of the final 'n' in certain contexts. That's what the 'eifelerRegelAppliesToWeekday'
7 // and 'eifelerRegelAppliesToNumber' methods are meant for
10 // Comment out broken wrapper, see T145382
11 /*if (typeof define === 'function' && define.amd) {
12 define(['moment'], factory); // AMD
13 } else if (typeof exports === 'object') {
14 module.exports = factory(require('../moment')); // Node
16 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
20 function processRelativeTime(number
, withoutSuffix
, key
, isFuture
) {
22 'm': ['eng Minutt', 'enger Minutt'],
23 'h': ['eng Stonn', 'enger Stonn'],
24 'd': ['een Dag', 'engem Dag'],
25 'M': ['ee Mount', 'engem Mount'],
26 'y': ['ee Joer', 'engem Joer']
28 return withoutSuffix
? format
[key
][0] : format
[key
][1];
31 function processFutureTime(string
) {
32 var number
= string
.substr(0, string
.indexOf(' '));
33 if (eifelerRegelAppliesToNumber(number
)) {
36 return 'an ' + string
;
39 function processPastTime(string
) {
40 var number
= string
.substr(0, string
.indexOf(' '));
41 if (eifelerRegelAppliesToNumber(number
)) {
42 return 'viru ' + string
;
44 return 'virun ' + string
;
48 * Returns true if the word before the given number loses the '-n' ending.
49 * e.g. 'an 10 Deeg' but 'a 5 Deeg'
51 * @param number {integer}
54 function eifelerRegelAppliesToNumber(number
) {
55 number
= parseInt(number
, 10);
60 // Negative Number --> always true
62 } else if (number
< 10) {
64 if (4 <= number
&& number
<= 7) {
68 } else if (number
< 100) {
70 var lastDigit
= number
% 10, firstDigit
= number
/ 10;
71 if (lastDigit
=== 0) {
72 return eifelerRegelAppliesToNumber(firstDigit
);
74 return eifelerRegelAppliesToNumber(lastDigit
);
75 } else if (number
< 10000) {
76 // 3 or 4 digits --> recursively check first digit
77 while (number
>= 10) {
80 return eifelerRegelAppliesToNumber(number
);
82 // Anything larger than 4 digits: recursively check first n-3 digits
83 number
= number
/ 1000;
84 return eifelerRegelAppliesToNumber(number
);
88 return moment
.defineLocale('lb', {
89 months
: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
90 monthsShort
: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
91 weekdays
: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
92 weekdaysShort
: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
93 weekdaysMin
: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
96 LTS
: 'H:mm:ss [Auer]',
99 LLL
: 'D. MMMM YYYY LT',
100 LLLL
: 'dddd, D. MMMM YYYY LT'
103 sameDay
: '[Haut um] LT',
105 nextDay
: '[Muer um] LT',
106 nextWeek
: 'dddd [um] LT',
107 lastDay
: '[Gëschter um] LT',
108 lastWeek: function () {
109 // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
110 switch (this.day()) {
113 return '[Leschten] dddd [um] LT';
115 return '[Leschte] dddd [um] LT';
120 future
: processFutureTime
,
121 past
: processPastTime
,
122 s
: 'e puer Sekonnen',
123 m
: processRelativeTime
,
125 h
: processRelativeTime
,
127 d
: processRelativeTime
,
129 M
: processRelativeTime
,
131 y
: processRelativeTime
,
134 ordinalParse
: /\d{1,2}\./,
137 dow
: 1, // Monday is the first day of the week.
138 doy
: 4 // The week that contains Jan 4th is the first week of the year.