LaravelTest
104 строки · 4.0 Кб
1//! moment.js locale configuration
2//! locale : Latvian [lv]
3//! author : Kristaps Karlsons : https://github.com/skakri
4//! author : Jānis Elmeris : https://github.com/JanisE
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
15var units = {16ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),17m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),18mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),19h: 'stundas_stundām_stunda_stundas'.split('_'),20hh: 'stundas_stundām_stunda_stundas'.split('_'),21d: 'dienas_dienām_diena_dienas'.split('_'),22dd: 'dienas_dienām_diena_dienas'.split('_'),23M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),24MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),25y: 'gada_gadiem_gads_gadi'.split('_'),26yy: 'gada_gadiem_gads_gadi'.split('_'),27};28/**29* @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
30*/
31function format(forms, number, withoutSuffix) {32if (withoutSuffix) {33// E.g. "21 minūte", "3 minūtes".34return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];35} else {36// E.g. "21 minūtes" as in "pēc 21 minūtes".37// E.g. "3 minūtēm" as in "pēc 3 minūtēm".38return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];39}40}41function relativeTimeWithPlural(number, withoutSuffix, key) {42return number + ' ' + format(units[key], number, withoutSuffix);43}44function relativeTimeWithSingular(number, withoutSuffix, key) {45return format(units[key], number, withoutSuffix);46}47function relativeSeconds(number, withoutSuffix) {48return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';49}50
51var lv = moment.defineLocale('lv', {52months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(53'_'54),55monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),56weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(57'_'58),59weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),60weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),61weekdaysParseExact: true,62longDateFormat: {63LT: 'HH:mm',64LTS: 'HH:mm:ss',65L: 'DD.MM.YYYY.',66LL: 'YYYY. [gada] D. MMMM',67LLL: 'YYYY. [gada] D. MMMM, HH:mm',68LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',69},70calendar: {71sameDay: '[Šodien pulksten] LT',72nextDay: '[Rīt pulksten] LT',73nextWeek: 'dddd [pulksten] LT',74lastDay: '[Vakar pulksten] LT',75lastWeek: '[Pagājušā] dddd [pulksten] LT',76sameElse: 'L',77},78relativeTime: {79future: 'pēc %s',80past: 'pirms %s',81s: relativeSeconds,82ss: relativeTimeWithPlural,83m: relativeTimeWithSingular,84mm: relativeTimeWithPlural,85h: relativeTimeWithSingular,86hh: relativeTimeWithPlural,87d: relativeTimeWithSingular,88dd: relativeTimeWithPlural,89M: relativeTimeWithSingular,90MM: relativeTimeWithPlural,91y: relativeTimeWithSingular,92yy: relativeTimeWithPlural,93},94dayOfMonthOrdinalParse: /\d{1,2}\./,95ordinal: '%d.',96week: {97dow: 1, // Monday is the first day of the week.98doy: 4, // The week that contains Jan 4th is the first week of the year.99},100});101
102return lv;103
104})));105