1 //! moment.js locale configuration
2 //! locale : polish (pl)
3 //! author : Rafal Hirsz : https://github.com/evoL
5 import moment from '../moment';
7 var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
8 monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
10 return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
12 function translate(number, withoutSuffix, key) {
13 var result = number + ' ';
16 return withoutSuffix ? 'minuta' : 'minutę';
18 return result + (plural(number) ? 'minuty' : 'minut');
20 return withoutSuffix ? 'godzina' : 'godzinę';
22 return result + (plural(number) ? 'godziny' : 'godzin');
24 return result + (plural(number) ? 'miesiące' : 'miesięcy');
26 return result + (plural(number) ? 'lata' : 'lat');
30 export default moment.defineLocale('pl', {
31 months : function (momentToFormat, format) {
33 // Hack: if format empty we know this is used to generate
34 // RegExp by moment. Give then back both valid forms of months
35 // in RegExp ready format.
36 return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
37 } else if (/D MMMM/.test(format)) {
38 return monthsSubjective[momentToFormat.month()];
40 return monthsNominative[momentToFormat.month()];
43 monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
44 weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
45 weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),
46 weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
52 LLL : 'D MMMM YYYY HH:mm',
53 LLLL : 'dddd, D MMMM YYYY HH:mm'
56 sameDay: '[Dziś o] LT',
57 nextDay: '[Jutro o] LT',
58 nextWeek: '[W] dddd [o] LT',
59 lastDay: '[Wczoraj o] LT',
60 lastWeek: function () {
63 return '[W zeszłą niedzielę o] LT';
65 return '[W zeszłą środę o] LT';
67 return '[W zeszłą sobotę o] LT';
69 return '[W zeszły] dddd [o] LT';
89 ordinalParse: /\d{1,2}\./,
92 dow : 1, // Monday is the first day of the week.
93 doy : 4 // The week that contains Jan 4th is the first week of the year.