LaravelTest
182 строки · 7.3 Кб
1//! moment.js locale configuration
2//! locale : Czech [cs]
3//! author : petrbela : https://github.com/petrbela
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 months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(15'_'16),17monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),18monthsParse = [19/^led/i,20/^úno/i,21/^bře/i,22/^dub/i,23/^kvě/i,24/^(čvn|červen$|června)/i,25/^(čvc|červenec|července)/i,26/^srp/i,27/^zář/i,28/^říj/i,29/^lis/i,30/^pro/i,31],32// NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.33// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.34monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;35
36function plural(n) {37return n > 1 && n < 5 && ~~(n / 10) !== 1;38}39function translate(number, withoutSuffix, key, isFuture) {40var result = number + ' ';41switch (key) {42case 's': // a few seconds / in a few seconds / a few seconds ago43return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';44case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago45if (withoutSuffix || isFuture) {46return result + (plural(number) ? 'sekundy' : 'sekund');47} else {48return result + 'sekundami';49}50case 'm': // a minute / in a minute / a minute ago51return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';52case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago53if (withoutSuffix || isFuture) {54return result + (plural(number) ? 'minuty' : 'minut');55} else {56return result + 'minutami';57}58case 'h': // an hour / in an hour / an hour ago59return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';60case 'hh': // 9 hours / in 9 hours / 9 hours ago61if (withoutSuffix || isFuture) {62return result + (plural(number) ? 'hodiny' : 'hodin');63} else {64return result + 'hodinami';65}66case 'd': // a day / in a day / a day ago67return withoutSuffix || isFuture ? 'den' : 'dnem';68case 'dd': // 9 days / in 9 days / 9 days ago69if (withoutSuffix || isFuture) {70return result + (plural(number) ? 'dny' : 'dní');71} else {72return result + 'dny';73}74case 'M': // a month / in a month / a month ago75return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';76case 'MM': // 9 months / in 9 months / 9 months ago77if (withoutSuffix || isFuture) {78return result + (plural(number) ? 'měsíce' : 'měsíců');79} else {80return result + 'měsíci';81}82case 'y': // a year / in a year / a year ago83return withoutSuffix || isFuture ? 'rok' : 'rokem';84case 'yy': // 9 years / in 9 years / 9 years ago85if (withoutSuffix || isFuture) {86return result + (plural(number) ? 'roky' : 'let');87} else {88return result + 'lety';89}90}91}92
93var cs = moment.defineLocale('cs', {94months: months,95monthsShort: monthsShort,96monthsRegex: monthsRegex,97monthsShortRegex: monthsRegex,98// NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.99// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.100monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,101monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,102monthsParse: monthsParse,103longMonthsParse: monthsParse,104shortMonthsParse: monthsParse,105weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),106weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),107weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),108longDateFormat: {109LT: 'H:mm',110LTS: 'H:mm:ss',111L: 'DD.MM.YYYY',112LL: 'D. MMMM YYYY',113LLL: 'D. MMMM YYYY H:mm',114LLLL: 'dddd D. MMMM YYYY H:mm',115l: 'D. M. YYYY',116},117calendar: {118sameDay: '[dnes v] LT',119nextDay: '[zítra v] LT',120nextWeek: function () {121switch (this.day()) {122case 0:123return '[v neděli v] LT';124case 1:125case 2:126return '[v] dddd [v] LT';127case 3:128return '[ve středu v] LT';129case 4:130return '[ve čtvrtek v] LT';131case 5:132return '[v pátek v] LT';133case 6:134return '[v sobotu v] LT';135}136},137lastDay: '[včera v] LT',138lastWeek: function () {139switch (this.day()) {140case 0:141return '[minulou neděli v] LT';142case 1:143case 2:144return '[minulé] dddd [v] LT';145case 3:146return '[minulou středu v] LT';147case 4:148case 5:149return '[minulý] dddd [v] LT';150case 6:151return '[minulou sobotu v] LT';152}153},154sameElse: 'L',155},156relativeTime: {157future: 'za %s',158past: 'před %s',159s: translate,160ss: translate,161m: translate,162mm: translate,163h: translate,164hh: translate,165d: translate,166dd: translate,167M: translate,168MM: translate,169y: translate,170yy: translate,171},172dayOfMonthOrdinalParse: /\d{1,2}\./,173ordinal: '%d.',174week: {175dow: 1, // Monday is the first day of the week.176doy: 4, // The week that contains Jan 4th is the first week of the year.177},178});179
180return cs;181
182})));183