4 $('.countdown').each(function() {
7 var serverTime = function() {
9 $.ajax({url: '/zegar/',
10 async: false, dataType: 'text',
11 success: function(text) {
12 time = new Date(text);
13 }, error: function(http, message, exc) {
19 if (LANGUAGE_CODE != 'en') {
20 $.countdown.setDefaults($.countdown.regional[LANGUAGE_CODE]);
23 $.countdown.setDefaults($.countdown.regional['']);
27 until: new Date($this.attr('data-until')),
29 serverSync: serverTime,
30 onExpiry: function(){location.reload()}, // TODO: no reload
32 if ($this.hasClass('inline')) {
33 options.layout = '{d<}{dn} {dl} {d>}{hnn}{sep}{mnn}{sep}{snn}';
36 $this.countdown(options);