Skip to content

Commit 97990e9

Browse files
committed
Merge remote-tracking branch 'trentrichardson/dev' into l10n-ampm
2 parents 195be63 + 00a2cad commit 97990e9

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,17 @@ $.datepicker._gotoToday = function(id) {
10171017
var inst = this._getInst($(id)[0]),
10181018
$dp = inst.dpDiv;
10191019
this._base_gotoToday(id);
1020-
this._setTime(this._getInst($(id)[0]), new Date());
1020+
var now = new Date();
1021+
var tp_inst = this._get(inst, 'timepicker');
1022+
if (tp_inst._defaults.showTimezone && tp_inst.timezone_select) {
1023+
var tzoffset = now.getTimezoneOffset(); // If +0100, returns -60
1024+
var tzsign = tzoffset > 0 ? '-' : '+';
1025+
tzoffset = Math.abs(tzoffset);
1026+
var tzmin = tzoffset % 60
1027+
tzoffset = tzsign + ('0' + (tzoffset - tzmin) / 60).slice(-2) + ('0' + tzmin).slice(-2);
1028+
tp_inst.timezone_select.val(tzoffset);
1029+
}
1030+
this._setTime(inst, now);
10211031
$( '.ui-datepicker-today', $dp).click();
10221032
};
10231033

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* German translation for the jQuery Timepicker Addon */
2+
/* Written by Michał Pena */
3+
(function($) {
4+
$.timepicker.regional['pl'] = {
5+
timeOnlyTitle: 'Wybierz godzinę',
6+
timeText: 'Czas',
7+
hourText: 'Godzina',
8+
minuteText: 'Minuta',
9+
secondText: 'Sekunda',
10+
millisecText: 'Milisekunda',
11+
timezoneText: 'Strefa czasowa',
12+
currentText: 'Teraz',
13+
closeText: 'Gotowe',
14+
timeFormat: 'hh:mm tt',
15+
ampm: false
16+
};
17+
$.timepicker.setDefaults($.timepicker.regional['pl']);
18+
})(jQuery);

0 commit comments

Comments
 (0)