From 81e325d3d7ba43ddd01e98c41a8bbb9ad5b9c08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ing=2E=20Jan=20Novotn=C3=BD?= Date: Mon, 26 Sep 2011 21:34:14 +0200 Subject: [PATCH 1/2] Issue when specifying stepHour/stepMinute/stepSecond along with min and max limits. Modulo was computed in relation with midnight instead of min limit. Error usecase: $('#example1').datetimepicker({ stepHour: 4, hourMin: 9, hourMax: 18 }); Would make steps 9-13-16 instead of 9-13-17. --- jquery-ui-timepicker-addon.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 4274950a..2ab9525b 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -265,9 +265,9 @@ $.extend(Timepicker.prototype, { // Added by Peter Medeiros: // - Figure out what the hour/minute/second max should be based on the step values. // - Example: if stepMinute is 15, then minMax is 45. - hourMax = (o.hourMax - (o.hourMax % o.stepHour)).toFixed(0), - minMax = (o.minuteMax - (o.minuteMax % o.stepMinute)).toFixed(0), - secMax = (o.secondMax - (o.secondMax % o.stepSecond)).toFixed(0), + hourMax = (o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)).toFixed(0), + minMax = (o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)).toFixed(0), + secMax = (o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)).toFixed(0), dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, ''); // Prevent displaying twice @@ -285,7 +285,7 @@ $.extend(Timepicker.prototype, { minuteGridSize = 0, secondGridSize = 0, size; - + if (o.showHour && o.hourGrid > 0) { html += '
' + '
' + @@ -586,9 +586,9 @@ $.extend(Timepicker.prototype, { } if(adjustSliders !== undefined && adjustSliders === true){ - var hourMax = (this._defaults.hourMax - (this._defaults.hourMax % this._defaults.stepHour)).toFixed(0), - minMax = (this._defaults.minuteMax - (this._defaults.minuteMax % this._defaults.stepMinute)).toFixed(0), - secMax = (this._defaults.secondMax - (this._defaults.secondMax % this._defaults.stepSecond)).toFixed(0); + var hourMax = (this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)).toFixed(0), + minMax = (this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)).toFixed(0), + secMax = (this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)).toFixed(0); if(this.hour_slider) this.hour_slider.slider("option", { min: this._defaults.hourMin, max: hourMax }).slider('value', this.hour); From 4f0eb62c393a603d8beff69e124a3f1f34ce7285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Novotn=C3=BD?= Date: Fri, 27 Jan 2012 10:48:05 +0100 Subject: [PATCH 2/2] Added Slovak localization. --- localization/jquery-ui-timepicker-sk.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 localization/jquery-ui-timepicker-sk.js diff --git a/localization/jquery-ui-timepicker-sk.js b/localization/jquery-ui-timepicker-sk.js new file mode 100644 index 00000000..1d55027c --- /dev/null +++ b/localization/jquery-ui-timepicker-sk.js @@ -0,0 +1,19 @@ +/* Slovak translation for the jQuery Timepicker Addon */ +/* Written by Andrea Pavolková */ +(function($) { + $.timepicker.regional['sk'] = { + timeOnlyTitle: 'Vyberte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minúty', + secondText: 'Sekundy', + timezoneText: 'Časové pásmo', + currentText: 'Teraz', + closeText: 'Zavrieť', + timeFormat: 'h:m', + ampm: false, + am: 'dop.', + pm: 'odp.' + }; + $.timepicker.setDefaults($.timepicker.regional['sk']); +})(jQuery); \ No newline at end of file