X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4b36a346031070515c3029e0050c1990e8a6a3eb..b93544446c1afb2324e12cef0e670705893797cd:/wolnelektury/static/js/jquery.countdown-pl.js?ds=sidebyside diff --git a/wolnelektury/static/js/jquery.countdown-pl.js b/wolnelektury/static/js/jquery.countdown-pl.js index c881a3d7a..6860a4bab 100644 --- a/wolnelektury/static/js/jquery.countdown-pl.js +++ b/wolnelektury/static/js/jquery.countdown-pl.js @@ -1,19 +1,17 @@ -/* http://keith-wood.name/countdown.html - * Polish initialisation for the jQuery countdown extension - * Written by Pawel Lewtak lewtak@gmail.com (2008) - * and Radek Czajka radoslaw.czajka@nowoczesnapolska.org.pl (2010) */ -(function($) { - $.countdown.regional['pl'] = { - labels: ['lat', 'miesięcy', 'tygodni', 'dni', 'godzin', 'minut', 'sekund'], - labels1: ['rok', 'miesiąc', 'tydzień', 'dzień', 'godzina', 'minuta', 'sekunda'], - labels2: ['lata', 'miesiące', 'tygodnie', 'dni', 'godziny', 'minuty', 'sekundy'], - compactLabels: ['l', 'm', 't', 'd'], - compactLabels1: ['r', 'm', 't', 'd'], - compactLabels2: ['l', 'm', 't', 'd'], - timeSeparator: ':', isRTL: false, - which: function(n){ - return n==1 ? 1 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 2 : 0; - } - }; - //$.countdown.setDefaults($.countdown.regional['pl']); -})(jQuery); \ No newline at end of file +/* http://keith-wood.name/countdown.html + * Polish initialisation for the jQuery countdown extension + * Written by Pawel Lewtak lewtak@gmail.com (2008) */ +(function($) { + $.countdown.regional['pl'] = { + labels: ['lat', 'miesięcy', 'tygodni', 'dni', 'godzin', 'minut', 'sekund'], + labels1: ['rok', 'miesiąc', 'tydzień', 'dzień', 'godzina', 'minuta', 'sekunda'], + labels2: ['lata', 'miesiące', 'tygodnie', 'dni', 'godziny', 'minuty', 'sekundy'], + compactLabels: ['l', 'm', 't', 'd'], compactLabels1: ['r', 'm', 't', 'd'], + whichLabels: function(amount) { + var units = amount % 10; + var tens = Math.floor((amount % 100) / 10); + return (amount == 1 ? 1 : (units >= 2 && units <= 4 && tens != 1 ? 2 : 0)); + }, + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regional['pl']); +})(jQuery);