Debian Codegraph @

resources/lib/moment/locale/pl.js

raw symbols SCIP
1 //! moment.js locale configuration
2 //! locale : Polish [pl]
3 //! author : Rafal Hirsz : https://github.com/evoL
4
5 ;(function (global, factory) {
6 typeof exports === 'object' && typeof module !== 'undefined'
7 && typeof require === 'function' ? factory(require('../moment')) :
8 typeof define === 'function' && define.amd ? define(['../moment'], factory) :
9 factory(global.moment)
10 }(this, (function (moment) { 'use strict';
11
12 //! moment.js locale configuration
13
14 var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
15 '_'
16 ),
17 monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
18 '_'
19 );
20 function plural(n) {
21 return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
22 }
23 function translate(number, withoutSuffix, key) {
24 var result = number + ' ';
25 switch (key) {
26 case 'ss':
27 return result + (plural(number) ? 'sekundy' : 'sekund');
28 case 'm':
29 return withoutSuffix ? 'minuta' : 'minutę';
30 case 'mm':
31 return result + (plural(number) ? 'minuty' : 'minut');
32 case 'h':
33 return withoutSuffix ? 'godzina' : 'godzinę';
34 case 'hh':
35 return result + (plural(number) ? 'godziny' : 'godzin');
36 case 'MM':
37 return result + (plural(number) ? 'miesiące' : 'miesięcy');
38 case 'yy':
39 return result + (plural(number) ? 'lata' : 'lat');
40 }
41 }
42
43 var pl = moment.defineLocale('pl', {
44 months: function (momentToFormat, format) {
45 if (!momentToFormat) {
46 return monthsNominative;
47 } else if (format === '') {
48 // Hack: if format empty we know this is used to generate
49 // RegExp by moment. Give then back both valid forms of months
50 // in RegExp ready format.
51 return (
52 '(' +
53 monthsSubjective[momentToFormat.month()] +
54 '|' +
55 monthsNominative[momentToFormat.month()] +
56 ')'
57 );
58 } else if (/D MMMM/.test(format)) {
59 return monthsSubjective[momentToFormat.month()];
60 } else {
61 return monthsNominative[momentToFormat.month()];
62 }
63 },
64 monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
65 weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(
66 '_'
67 ),
68 weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
69 weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
70 longDateFormat: {
71 LT: 'HH:mm',
72 LTS: 'HH:mm:ss',
73 L: 'DD.MM.YYYY',
74 LL: 'D MMMM YYYY',
75 LLL: 'D MMMM YYYY HH:mm',
76 LLLL: 'dddd, D MMMM YYYY HH:mm',
77 },
78 calendar: {
79 sameDay: '[Dziś o] LT',
80 nextDay: '[Jutro o] LT',
81 nextWeek: function () {
82 switch (this.day()) {
83 case 0:
84 return '[W niedzielę o] LT';
85
86 case 2:
87 return '[We wtorek o] LT';
88
89 case 3:
90 return '[W środę o] LT';
91
92 case 6:
93 return '[W sobotę o] LT';
94
95 default:
96 return '[W] dddd [o] LT';
97 }
98 },
99 lastDay: '[Wczoraj o] LT',
100 lastWeek: function () {
101 switch (this.day()) {
102 case 0:
103 return '[W zeszłą niedzielę o] LT';
104 case 3:
105 return '[W zeszłą środę o] LT';
106 case 6:
107 return '[W zeszłą sobotę o] LT';
108 default:
109 return '[W zeszły] dddd [o] LT';
110 }
111 },
112 sameElse: 'L',
113 },
114 relativeTime: {
115 future: 'za %s',
116 past: '%s temu',
117 s: 'kilka sekund',
118 ss: translate,
119 m: translate,
120 mm: translate,
121 h: translate,
122 hh: translate,
123 d: '1 dzień',
124 dd: '%d dni',
125 M: 'miesiąc',
126 MM: translate,
127 y: 'rok',
128 yy: translate,
129 },
130 dayOfMonthOrdinalParse: /\d{1,2}\./,
131 ordinal: '%d.',
132 week: {
133 dow: 1, // Monday is the first day of the week.
134 doy: 4, // The week that contains Jan 4th is the first week of the year.
135 },
136 });
137
138 return pl;
139
140 })));