LaravelTest
129 строк · 4.4 Кб
1//! moment.js locale configuration
2//! locale : Serbian [sr]
3//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
4//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
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 translator = {16words: {17//Different grammatical cases18ss: ['sekunda', 'sekunde', 'sekundi'],19m: ['jedan minut', 'jedne minute'],20mm: ['minut', 'minute', 'minuta'],21h: ['jedan sat', 'jednog sata'],22hh: ['sat', 'sata', 'sati'],23dd: ['dan', 'dana', 'dana'],24MM: ['mesec', 'meseca', 'meseci'],25yy: ['godina', 'godine', 'godina'],26},27correctGrammaticalCase: function (number, wordKey) {28return number === 129? wordKey[0]30: number >= 2 && number <= 431? wordKey[1]32: wordKey[2];33},34translate: function (number, withoutSuffix, key) {35var wordKey = translator.words[key];36if (key.length === 1) {37return withoutSuffix ? wordKey[0] : wordKey[1];38} else {39return (40number +41' ' +42translator.correctGrammaticalCase(number, wordKey)43);44}45},46};47
48var sr = moment.defineLocale('sr', {49months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(50'_'51),52monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(53'_'54),55monthsParseExact: true,56weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(57'_'58),59weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),60weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),61weekdaysParseExact: true,62longDateFormat: {63LT: 'H:mm',64LTS: 'H:mm:ss',65L: 'D. M. YYYY.',66LL: 'D. MMMM YYYY.',67LLL: 'D. MMMM YYYY. H:mm',68LLLL: 'dddd, D. MMMM YYYY. H:mm',69},70calendar: {71sameDay: '[danas u] LT',72nextDay: '[sutra u] LT',73nextWeek: function () {74switch (this.day()) {75case 0:76return '[u] [nedelju] [u] LT';77case 3:78return '[u] [sredu] [u] LT';79case 6:80return '[u] [subotu] [u] LT';81case 1:82case 2:83case 4:84case 5:85return '[u] dddd [u] LT';86}87},88lastDay: '[juče u] LT',89lastWeek: function () {90var lastWeekDays = [91'[prošle] [nedelje] [u] LT',92'[prošlog] [ponedeljka] [u] LT',93'[prošlog] [utorka] [u] LT',94'[prošle] [srede] [u] LT',95'[prošlog] [četvrtka] [u] LT',96'[prošlog] [petka] [u] LT',97'[prošle] [subote] [u] LT',98];99return lastWeekDays[this.day()];100},101sameElse: 'L',102},103relativeTime: {104future: 'za %s',105past: 'pre %s',106s: 'nekoliko sekundi',107ss: translator.translate,108m: translator.translate,109mm: translator.translate,110h: translator.translate,111hh: translator.translate,112d: 'dan',113dd: translator.translate,114M: 'mesec',115MM: translator.translate,116y: 'godinu',117yy: translator.translate,118},119dayOfMonthOrdinalParse: /\d{1,2}\./,120ordinal: '%d.',121week: {122dow: 1, // Monday is the first day of the week.123doy: 7, // The week that contains Jan 7th is the first week of the year.124},125});126
127return sr;128
129})));130