LaravelTest
146 строк · 5.0 Кб
1//! moment.js locale configuration
2//! locale : Luxembourgish [lb]
3//! author : mweimerskirch : https://github.com/mweimerskirch
4//! author : David Raison : https://github.com/kwisatz
5
6;(function (global, factory) {7typeof exports === 'object' && typeof module !== 'undefined'8&& typeof require === 'function' ? factory(require('../moment')) :9typeof define === 'function' && define.amd ? define(['../moment'], factory) :10factory(global.moment)11}(this, (function (moment) { 'use strict';12
13//! moment.js locale configuration14
15function processRelativeTime(number, withoutSuffix, key, isFuture) {16var format = {17m: ['eng Minutt', 'enger Minutt'],18h: ['eng Stonn', 'enger Stonn'],19d: ['een Dag', 'engem Dag'],20M: ['ee Mount', 'engem Mount'],21y: ['ee Joer', 'engem Joer'],22};23return withoutSuffix ? format[key][0] : format[key][1];24}25function processFutureTime(string) {26var number = string.substr(0, string.indexOf(' '));27if (eifelerRegelAppliesToNumber(number)) {28return 'a ' + string;29}30return 'an ' + string;31}32function processPastTime(string) {33var number = string.substr(0, string.indexOf(' '));34if (eifelerRegelAppliesToNumber(number)) {35return 'viru ' + string;36}37return 'virun ' + string;38}39/**40* Returns true if the word before the given number loses the '-n' ending.
41* e.g. 'an 10 Deeg' but 'a 5 Deeg'
42*
43* @param number {integer}
44* @returns {boolean}
45*/
46function eifelerRegelAppliesToNumber(number) {47number = parseInt(number, 10);48if (isNaN(number)) {49return false;50}51if (number < 0) {52// Negative Number --> always true53return true;54} else if (number < 10) {55// Only 1 digit56if (4 <= number && number <= 7) {57return true;58}59return false;60} else if (number < 100) {61// 2 digits62var lastDigit = number % 10,63firstDigit = number / 10;64if (lastDigit === 0) {65return eifelerRegelAppliesToNumber(firstDigit);66}67return eifelerRegelAppliesToNumber(lastDigit);68} else if (number < 10000) {69// 3 or 4 digits --> recursively check first digit70while (number >= 10) {71number = number / 10;72}73return eifelerRegelAppliesToNumber(number);74} else {75// Anything larger than 4 digits: recursively check first n-3 digits76number = number / 1000;77return eifelerRegelAppliesToNumber(number);78}79}80
81var lb = moment.defineLocale('lb', {82months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(83'_'84),85monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(86'_'87),88monthsParseExact: true,89weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(90'_'91),92weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),93weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),94weekdaysParseExact: true,95longDateFormat: {96LT: 'H:mm [Auer]',97LTS: 'H:mm:ss [Auer]',98L: 'DD.MM.YYYY',99LL: 'D. MMMM YYYY',100LLL: 'D. MMMM YYYY H:mm [Auer]',101LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',102},103calendar: {104sameDay: '[Haut um] LT',105sameElse: 'L',106nextDay: '[Muer um] LT',107nextWeek: 'dddd [um] LT',108lastDay: '[Gëschter um] LT',109lastWeek: function () {110// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule111switch (this.day()) {112case 2:113case 4:114return '[Leschten] dddd [um] LT';115default:116return '[Leschte] dddd [um] LT';117}118},119},120relativeTime: {121future: processFutureTime,122past: processPastTime,123s: 'e puer Sekonnen',124ss: '%d Sekonnen',125m: processRelativeTime,126mm: '%d Minutten',127h: processRelativeTime,128hh: '%d Stonnen',129d: processRelativeTime,130dd: '%d Deeg',131M: processRelativeTime,132MM: '%d Méint',133y: processRelativeTime,134yy: '%d Joer',135},136dayOfMonthOrdinalParse: /\d{1,2}\./,137ordinal: '%d.',138week: {139dow: 1, // Monday is the first day of the week.140doy: 4, // The week that contains Jan 4th is the first week of the year.141},142});143
144return lb;145
146})));147