diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 2e25b6d..e3b68c7 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -1017,7 +1017,17 @@ $.datepicker._gotoToday = function(id) { var inst = this._getInst($(id)[0]), $dp = inst.dpDiv; this._base_gotoToday(id); - this._setTime(this._getInst($(id)[0]), new Date()); + var now = new Date(); + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst._defaults.showTimezone && tp_inst.timezone_select) { + var tzoffset = now.getTimezoneOffset(); // If +0100, returns -60 + var tzsign = tzoffset > 0 ? '-' : '+'; + tzoffset = Math.abs(tzoffset); + var tzmin = tzoffset % 60 + tzoffset = tzsign + ('0' + (tzoffset - tzmin) / 60).slice(-2) + ('0' + tzmin).slice(-2); + tp_inst.timezone_select.val(tzoffset); + } + this._setTime(inst, now); $( '.ui-datepicker-today', $dp).click(); }; diff --git a/localization/jquery-ui-timepicker-pl.js b/localization/jquery-ui-timepicker-pl.js new file mode 100644 index 0000000..4597b8a --- /dev/null +++ b/localization/jquery-ui-timepicker-pl.js @@ -0,0 +1,18 @@ +/* German translation for the jQuery Timepicker Addon */ +/* Written by Michał Pena */ +(function($) { + $.timepicker.regional['pl'] = { + timeOnlyTitle: 'Wybierz godzinę', + timeText: 'Czas', + hourText: 'Godzina', + minuteText: 'Minuta', + secondText: 'Sekunda', + millisecText: 'Milisekunda', + timezoneText: 'Strefa czasowa', + currentText: 'Teraz', + closeText: 'Gotowe', + timeFormat: 'hh:mm tt', + ampm: false + }; + $.timepicker.setDefaults($.timepicker.regional['pl']); +})(jQuery);