UNPKG

5.03 kBJavaScriptView Raw
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 =
15 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
16 '_'
17 ),
18 monthsSubjective =
19 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
20 '_'
21 ),
22 monthsParse = [
23 /^sty/i,
24 /^lut/i,
25 /^mar/i,
26 /^kwi/i,
27 /^maj/i,
28 /^cze/i,
29 /^lip/i,
30 /^sie/i,
31 /^wrz/i,
32 /^paź/i,
33 /^lis/i,
34 /^gru/i,
35 ];
36 function plural(n) {
37 return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
38 }
39 function translate(number, withoutSuffix, key) {
40 var result = number + ' ';
41 switch (key) {
42 case 'ss':
43 return result + (plural(number) ? 'sekundy' : 'sekund');
44 case 'm':
45 return withoutSuffix ? 'minuta' : 'minutę';
46 case 'mm':
47 return result + (plural(number) ? 'minuty' : 'minut');
48 case 'h':
49 return withoutSuffix ? 'godzina' : 'godzinę';
50 case 'hh':
51 return result + (plural(number) ? 'godziny' : 'godzin');
52 case 'ww':
53 return result + (plural(number) ? 'tygodnie' : 'tygodni');
54 case 'MM':
55 return result + (plural(number) ? 'miesiące' : 'miesięcy');
56 case 'yy':
57 return result + (plural(number) ? 'lata' : 'lat');
58 }
59 }
60
61 var pl = moment.defineLocale('pl', {
62 months: function (momentToFormat, format) {
63 if (!momentToFormat) {
64 return monthsNominative;
65 } else if (/D MMMM/.test(format)) {
66 return monthsSubjective[momentToFormat.month()];
67 } else {
68 return monthsNominative[momentToFormat.month()];
69 }
70 },
71 monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
72 monthsParse: monthsParse,
73 longMonthsParse: monthsParse,
74 shortMonthsParse: monthsParse,
75 weekdays:
76 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
77 weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
78 weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
79 longDateFormat: {
80 LT: 'HH:mm',
81 LTS: 'HH:mm:ss',
82 L: 'DD.MM.YYYY',
83 LL: 'D MMMM YYYY',
84 LLL: 'D MMMM YYYY HH:mm',
85 LLLL: 'dddd, D MMMM YYYY HH:mm',
86 },
87 calendar: {
88 sameDay: '[Dziś o] LT',
89 nextDay: '[Jutro o] LT',
90 nextWeek: function () {
91 switch (this.day()) {
92 case 0:
93 return '[W niedzielę o] LT';
94
95 case 2:
96 return '[We wtorek o] LT';
97
98 case 3:
99 return '[W środę o] LT';
100
101 case 6:
102 return '[W sobotę o] LT';
103
104 default:
105 return '[W] dddd [o] LT';
106 }
107 },
108 lastDay: '[Wczoraj o] LT',
109 lastWeek: function () {
110 switch (this.day()) {
111 case 0:
112 return '[W zeszłą niedzielę o] LT';
113 case 3:
114 return '[W zeszłą środę o] LT';
115 case 6:
116 return '[W zeszłą sobotę o] LT';
117 default:
118 return '[W zeszły] dddd [o] LT';
119 }
120 },
121 sameElse: 'L',
122 },
123 relativeTime: {
124 future: 'za %s',
125 past: '%s temu',
126 s: 'kilka sekund',
127 ss: translate,
128 m: translate,
129 mm: translate,
130 h: translate,
131 hh: translate,
132 d: '1 dzień',
133 dd: '%d dni',
134 w: 'tydzień',
135 ww: translate,
136 M: 'miesiąc',
137 MM: translate,
138 y: 'rok',
139 yy: translate,
140 },
141 dayOfMonthOrdinalParse: /\d{1,2}\./,
142 ordinal: '%d.',
143 week: {
144 dow: 1, // Monday is the first day of the week.
145 doy: 4, // The week that contains Jan 4th is the first week of the year.
146 },
147 });
148
149 return pl;
150
151})));