LaravelTest
136 строк · 4.4 Кб
1//! moment.js locale configuration
2//! locale : Klingon [tlh]
3//! author : Dominika Kruk : https://github.com/amaranthrose
4
5;(function (global, factory) {6typeof exports === 'object' && typeof module !== 'undefined'7&& typeof require === 'function' ? factory(require('../moment')) :8typeof define === 'function' && define.amd ? define(['../moment'], factory) :9factory(global.moment)10}(this, (function (moment) { 'use strict';11
12//! moment.js locale configuration13
14var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');15
16function translateFuture(output) {17var time = output;18time =19output.indexOf('jaj') !== -120? time.slice(0, -3) + 'leS'21: output.indexOf('jar') !== -122? time.slice(0, -3) + 'waQ'23: output.indexOf('DIS') !== -124? time.slice(0, -3) + 'nem'25: time + ' pIq';26return time;27}28
29function translatePast(output) {30var time = output;31time =32output.indexOf('jaj') !== -133? time.slice(0, -3) + 'Hu’'34: output.indexOf('jar') !== -135? time.slice(0, -3) + 'wen'36: output.indexOf('DIS') !== -137? time.slice(0, -3) + 'ben'38: time + ' ret';39return time;40}41
42function translate(number, withoutSuffix, string, isFuture) {43var numberNoun = numberAsNoun(number);44switch (string) {45case 'ss':46return numberNoun + ' lup';47case 'mm':48return numberNoun + ' tup';49case 'hh':50return numberNoun + ' rep';51case 'dd':52return numberNoun + ' jaj';53case 'MM':54return numberNoun + ' jar';55case 'yy':56return numberNoun + ' DIS';57}58}59
60function numberAsNoun(number) {61var hundred = Math.floor((number % 1000) / 100),62ten = Math.floor((number % 100) / 10),63one = number % 10,64word = '';65if (hundred > 0) {66word += numbersNouns[hundred] + 'vatlh';67}68if (ten > 0) {69word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';70}71if (one > 0) {72word += (word !== '' ? ' ' : '') + numbersNouns[one];73}74return word === '' ? 'pagh' : word;75}76
77var tlh = moment.defineLocale('tlh', {78months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(79'_'80),81monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(82'_'83),84monthsParseExact: true,85weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(86'_'87),88weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(89'_'90),91weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(92'_'93),94longDateFormat: {95LT: 'HH:mm',96LTS: 'HH:mm:ss',97L: 'DD.MM.YYYY',98LL: 'D MMMM YYYY',99LLL: 'D MMMM YYYY HH:mm',100LLLL: 'dddd, D MMMM YYYY HH:mm',101},102calendar: {103sameDay: '[DaHjaj] LT',104nextDay: '[wa’leS] LT',105nextWeek: 'LLL',106lastDay: '[wa’Hu’] LT',107lastWeek: 'LLL',108sameElse: 'L',109},110relativeTime: {111future: translateFuture,112past: translatePast,113s: 'puS lup',114ss: translate,115m: 'wa’ tup',116mm: translate,117h: 'wa’ rep',118hh: translate,119d: 'wa’ jaj',120dd: translate,121M: 'wa’ jar',122MM: translate,123y: 'wa’ DIS',124yy: translate,125},126dayOfMonthOrdinalParse: /\d{1,2}\./,127ordinal: '%d.',128week: {129dow: 1, // Monday is the first day of the week.130doy: 4, // The week that contains Jan 4th is the first week of the year.131},132});133
134return tlh;135
136})));137