summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2012-11-03 10:35:26 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2012-11-03 10:35:26 -0400
commitf503ab255f4424db94ae58db2286c76b4165dd7e (patch)
treed1797078720f52d3620cb3197d2870e9bc1bfc4c
parent033696b0b6723dd24615ae109a3eb6f6154c8847 (diff)
parentb067e362585df20fbde3f1a7eb3c421c9d03b0ea (diff)
downloadjQuery-Timepicker-Addon-f503ab255f4424db94ae58db2286c76b4165dd7e.zip
jQuery-Timepicker-Addon-f503ab255f4424db94ae58db2286c76b4165dd7e.tar.gz
jQuery-Timepicker-Addon-f503ab255f4424db94ae58db2286c76b4165dd7e.tar.bz2
Update last mod date
-rw-r--r--index.html128
-rw-r--r--jquery-ui-sliderAccess.js11
-rw-r--r--jquery-ui-timepicker-addon.js487
-rw-r--r--localization/jquery-ui-timepicker-af.js3
-rw-r--r--localization/jquery-ui-timepicker-bg.js3
-rw-r--r--localization/jquery-ui-timepicker-ca.js3
-rw-r--r--localization/jquery-ui-timepicker-cs.js3
-rw-r--r--localization/jquery-ui-timepicker-de.js3
-rw-r--r--localization/jquery-ui-timepicker-el.js3
-rw-r--r--localization/jquery-ui-timepicker-es.js3
-rw-r--r--localization/jquery-ui-timepicker-et.js3
-rw-r--r--localization/jquery-ui-timepicker-fi.js3
-rw-r--r--localization/jquery-ui-timepicker-fr.js3
-rw-r--r--localization/jquery-ui-timepicker-gl.js3
-rw-r--r--localization/jquery-ui-timepicker-he.js3
-rw-r--r--localization/jquery-ui-timepicker-hu.js3
-rw-r--r--localization/jquery-ui-timepicker-id.js3
-rw-r--r--localization/jquery-ui-timepicker-it.js3
-rw-r--r--localization/jquery-ui-timepicker-ja.js3
-rw-r--r--localization/jquery-ui-timepicker-ko.js1
-rw-r--r--localization/jquery-ui-timepicker-lt.js3
-rw-r--r--localization/jquery-ui-timepicker-nl.js3
-rw-r--r--localization/jquery-ui-timepicker-no.js3
-rw-r--r--localization/jquery-ui-timepicker-pl.js3
-rw-r--r--localization/jquery-ui-timepicker-pt-BR.js3
-rw-r--r--localization/jquery-ui-timepicker-pt.js3
-rw-r--r--localization/jquery-ui-timepicker-ro.js3
-rw-r--r--localization/jquery-ui-timepicker-ru.js3
-rw-r--r--localization/jquery-ui-timepicker-sk.js3
-rw-r--r--localization/jquery-ui-timepicker-sv.js3
-rw-r--r--localization/jquery-ui-timepicker-tr.js3
-rw-r--r--localization/jquery-ui-timepicker-uk.js3
-rw-r--r--localization/jquery-ui-timepicker-vi.js3
-rw-r--r--localization/jquery-ui-timepicker-zh-CN.js3
-rw-r--r--localization/jquery-ui-timepicker-zh-TW.js3
35 files changed, 408 insertions, 312 deletions
diff --git a/index.html b/index.html
index dfa6e96..0c6bffe 100644
--- a/index.html
+++ b/index.html
@@ -35,11 +35,11 @@
.example-container input{ border: solid 1px #aaa; padding: 4px; width: 175px; }
</style>
- <link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.8.23/themes/smoothness/jquery-ui.css" />
+ <link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
- <script type="text/javascript" src="http://code.jquery.com/ui/1.8.24/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
<script type="text/javascript">
@@ -122,11 +122,11 @@
<h3>Version</h3>
- <p>Version 1.0.5</p>
+ <p>Version 1.1.0</p>
- <p>Last updated on 10/06/2012</p>
-
+ <p>Last updated on 11/03/2012</p>
+
<p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under both MIT and GPL licenses. This means that you can choose the license that best suits your project, and use it accordingly. </p>
<p><a href="http://trentrichardson.com/Impromptu/GPL-LICENSE.txt" title="GPL License">GPL License</a></p>
<p><a href="http://trentrichardson.com/Impromptu/MIT-LICENSE.txt" title="MIT License">MIT License</a></p>
@@ -149,9 +149,6 @@
<dt>closeText</dt>
<dd><em>Default: "Done", A Localization Setting</em> - Text for the Close button.</dd>
- <dt>ampm</dt>
- <dd><em>Default: false, A Localization Setting</em> - Whether or not to use am/pm calculations.</dd>
-
<dt>amNames</dt>
<dd><em>Default: ['AM', 'A'], A Localization Setting</em> - Array of strings to try and parse against to determine AM.</dd>
@@ -159,7 +156,7 @@
<dd><em>Default: ['PM', 'P'], A Localization Setting</em> - Array of strings to try and parse against to determine PM.</dd>
<dt>timeFormat</dt>
- <dd><em>Default: "hh:mm tt", A Localization Setting</em> - String of format tokens to be replaced with the time. <a href="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
+ <dd><em>Default: "HH:mm", A Localization Setting</em> - String of format tokens to be replaced with the time. <a href="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
<dt>timeSuffix</dt>
<dd><em>Default: "", A Localization Setting</em> - String to place after the formatted time.</dd>
@@ -225,7 +222,19 @@
<dl class="defs">
<dt>controlType</dt>
- <dd><em>Default: 'slider'</em> - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.</dd>
+ <dd><em>Default: 'slider'</em> - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.
+<pre>{
+ create: function(tp_inst, obj, unit, val, min, max, step){
+ // generate whatever controls you want here, just return obj
+ },
+ options: function(tp_inst, obj, unit, opts, val){
+ // if val==undefined return the value, else return obj
+ },
+ value: function(tp_inst, obj, unit, val){
+ // if val==undefined return the value, else return obj
+ }
+}</pre>
+ </dd>
<dt>showHour</dt>
<dd><em>Default: true</em> - Whether to show the hour slider.</dd>
@@ -326,6 +335,12 @@
<dt>separator</dt>
<dd><em>Default: " "</em> - When formatting the time this string is placed between the formatted date and formatted time.</dd>
+ <dt>pickerTimeFormat</dt>
+ <dd><em>Default: (timeFormat option)</em> - How to format the time displayed within the timepicker.</dd>
+
+ <dt>pickerTimeSuffix</dt>
+ <dd><em>Default: (timeSuffix option)</em> - String to place after the formatted time within the timepicker.</dd>
+
<dt>showTimepicker</dt>
<dd><em>Default: true</em> - Whether to show the timepicker within the datepicker.</dd>
@@ -343,6 +358,17 @@
<dt>maxDateTime</dt>
<dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
+
+ <dt>parse</dt>
+ <dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
+<pre>{
+ hour: 19,
+ minutes: 10,
+ seconds: 23,
+ millisec: 45,
+ timezone: '-0400'
+}</pre>
+ </dd>
</dl>
</div>
@@ -355,11 +381,13 @@
<h2>Formatting Your Time</h2>
- <p>The default format is "hh:mm tt", however ampm is turned off by default, so you will see "hh:mm"</p>
+ <p>The default format is "HH:mm". To use 12 hour time use something similar to: "hh:mm tt". When both "t" and lower case "h" are present in the timeFormat, 12 hour time will be used.</p>
<dl class="defs">
- <dt>h</dt><dd>Hour with no leading 0</dd>
- <dt>hh</dt><dd>Hour with leading 0</dd>
+ <dt>H</dt><dd>Hour with no leading 0 (24 hour)</dd>
+ <dt>HH</dt><dd>Hour with leading 0 (24 hour)</dd>
+ <dt>h</dt><dd>Hour with no leading 0 (12 hour)</dd>
+ <dt>hh</dt><dd>Hour with leading 0 (12 hour)</dd>
<dt>m</dt><dd>Minute with no leading 0</dd>
<dt>mm</dt><dd>Minute with leading 0</dd>
<dt>s</dt><dd>Second with no leading 0</dd>
@@ -377,6 +405,7 @@
<ul>
<li>timeFormat option</li>
<li>altTimeFormat option</li>
+ <li>pickerTimeFormat option</li>
<li>$.datepicker.formatTime(format, timeObj, options) utility method</li>
<li>$.datepicker.parseTime(format, timeStr, options) utility method</li>
</ul>
@@ -439,10 +468,9 @@ $.timepicker.regional['ru'] = {
timezoneText: 'Часовой пояс',
currentText: 'Сейчас',
closeText: 'Закрыть',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ru']);
@@ -499,8 +527,7 @@ $('#basic_example_2').timepicker();
</div>
<pre>
$('#basic_example_3').datetimepicker({
- timeFormat: "h:m t",
- ampm: true
+ timeFormat: "hh:mm tt"
});
</pre>
</div>
@@ -515,7 +542,7 @@ $('#basic_example_3').datetimepicker({
</div>
<pre>
$('#timezone_example_1').datetimepicker({
- timeFormat: 'hh:mm z',
+ timeFormat: 'hh:mm tt z',
showTimezone: true
});
</pre>
@@ -529,7 +556,7 @@ $('#timezone_example_1').datetimepicker({
</div>
<pre>
$('#timezone_example_2').datetimepicker({
- timeFormat: 'hh:mm z',
+ timeFormat: 'HH:mm z',
showTimezone: true,
timezoneList: [
{ value: '-0500', label: 'Eastern'},
@@ -549,7 +576,7 @@ $('#timezone_example_2').datetimepicker({
</div>
<pre>
$('#timezone_example_3').datetimepicker({
- timeFormat: 'hh:mm z',
+ timeFormat: 'HH:mm z',
showTimezone: true,
timezone: 'MT',
timezoneList: [
@@ -574,7 +601,8 @@ $('#timezone_example_3').datetimepicker({
<pre>
$('#slider_example_1').timepicker({
hourGrid: 4,
- minuteGrid: 10
+ minuteGrid: 10,
+ timeFormat: 'hh:mm tt'
});
</pre>
</div>
@@ -588,7 +616,7 @@ $('#slider_example_1').timepicker({
<pre>
$('#slider_example_2').datetimepicker({
showSecond: true,
- timeFormat: 'hh:mm:ss',
+ timeFormat: 'HH:mm:ss',
stepHour: 2,
stepMinute: 10,
stepSecond: 10
@@ -618,7 +646,50 @@ $('#slider_example_3').datetimepicker({
<pre>
$('#slider_example_4').datetimepicker({
controlType: 'select',
- ampm: true
+ timeFormat: 'hh:mm tt'
+});</pre>
+ </div>
+
+ <!-- ============= example -->
+ <div class="example-container">
+ <p>Create your own control by implementing the create, options, and value methods. If you want to use your new control for all instances use the $.timepicker.setDefaults({controlType:myControl}). Here we implement jQueryUI's spinner control (jQueryUI 1.9+).</p>
+ <div>
+ <input type="text" name="slider_example_5" id="slider_example_5" value="" />
+ </div>
+<pre>var myControl= {
+ create: function(tp_inst, obj, unit, val, min, max, step){
+ $('&lt;input class="ui-timepicker-input" value="'+val+'" style="width:50%"&gt;')
+ .appendTo(obj)
+ .spinner({
+ min: min,
+ max: max,
+ step: step,
+ change: function(e,ui){ // key events
+ tp_inst._onTimeChange();
+ tp_inst._onSelectHandler();
+ },
+ spin: function(e,ui){ // spin events
+ tp_inst.control.value(tp_inst, obj, unit, ui.value);
+ tp_inst._onTimeChange();
+ tp_inst._onSelectHandler();
+ }
+ });
+ return obj;
+ },
+ options: function(tp_inst, obj, unit, opts, val){
+ if(typeof(opts) == 'string' && val !== undefined)
+ return obj.find('.ui-timepicker-input').spinner(opts, val);
+ return obj.find('.ui-timepicker-input').spinner(opts);
+ },
+ value: function(tp_inst, obj, unit, val){
+ if(val !== undefined)
+ return obj.find('.ui-timepicker-input').spinner('value', val);
+ return obj.find('.ui-timepicker-input').spinner('value');
+ }
+};
+
+$('#slider_example_5').datetimepicker({
+ controlType: myControl
});</pre>
</div>
@@ -662,10 +733,11 @@ $('#alt_example_2').datetimepicker({
</div>
<pre>
$('#alt_example_3').datetimepicker({
+ ampm: true,
altField: "#alt_example_3_alt",
altFieldTimeOnly: false,
altFormat: "yy-mm-dd",
- altTimeFormat: "h:m",
+ altTimeFormat: "h:m t",
altSeparator: " @ "
});
</pre>
@@ -696,7 +768,6 @@ $('#alt_example_4').datetimepicker({
</div>
<pre>
$('#rest_example_1').timepicker({
- ampm: true,
hourMin: 8,
hourMax: 16
});
@@ -795,8 +866,7 @@ var ex13 = $('#utility_example_1');
ex13.datetimepicker({
dateFormat: "D MM d, yy",
- separator: ' @ ',
- ampm: true
+ separator: ' @ '
});
$('#utility_example_1_setdt').click(function(){
@@ -824,7 +894,7 @@ $('#utility_example_1_getdt').click(function(){
<pre>
$('#utility_example_2').text(
- $.datepicker.formatTime('hh:mm z', { hour: 14, minute: 36, timezone: '+2000' }, { ampm: false })
+ $.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
);
</pre>
</div>
@@ -844,7 +914,7 @@ $('#utility_example_2').text(
<pre>
$('#utility_example_3').text(JSON.stringify(
- $.datepicker.parseTime('hh:mm:ss:l z', "14:36:21:765 +2000", { ampm: false })
+ $.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {})
));
</pre>
</div>
diff --git a/jquery-ui-sliderAccess.js b/jquery-ui-sliderAccess.js
index be514d1..a54cf4a 100644
--- a/jquery-ui-sliderAccess.js
+++ b/jquery-ui-sliderAccess.js
@@ -1,8 +1,8 @@
/*
* jQuery UI Slider Access
* By: Trent Richardson [http://trentrichardson.com]
- * Version 0.2
- * Last Modified: 12/02/2011
+ * Version 0.3
+ * Last Modified: 10/20/2012
*
* Copyright 2011 Trent Richardson
* Dual licensed under the MIT and GPL licenses.
@@ -50,7 +50,9 @@
curr = $t.slider('value'),
newval = curr += step*1,
minval = $t.slider('option','min'),
- maxval = $t.slider('option','max');
+ maxval = $t.slider('option','max'),
+ slidee = $t.slider("option", "slide") || function(){},
+ stope = $t.slider("option", "stop") || function(){};
e.preventDefault();
@@ -59,7 +61,8 @@
$t.slider('value', newval);
- $t.slider("option", "slide").call($t, null, { value: newval });
+ slidee.call($t, null, { value: newval });
+ stope.call($t, null, { value: newval });
});
});
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 2b83b57..f65770a 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -1,8 +1,8 @@
/*
* jQuery timepicker addon
* By: Trent Richardson [http://trentrichardson.com]
- * Version 1.0.5
- * Last Modified: 10/06/2012
+ * Version 1.1.0
+ * Last Modified: 11/03/2012
*
* Copyright 2012 Trent Richardson
* You may use this project under MIT or GPL licenses.
@@ -27,7 +27,7 @@
*/
$.extend($.ui, {
timepicker: {
- version: "1.0.5"
+ version: "1.1.0"
}
});
@@ -42,10 +42,9 @@
this.regional[''] = { // Default regional settings
currentText: 'Now',
closeText: 'Done',
- ampm: false,
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
timeSuffix: '',
timeOnlyTitle: 'Choose Time',
timeText: 'Time',
@@ -94,15 +93,19 @@
alwaysSetTime: true,
separator: ' ',
altFieldTimeOnly: true,
+ altTimeFormat: null,
altSeparator: null,
altTimeSuffix: null,
+ pickerTimeFormat: null,
+ pickerTimeSuffix: null,
showTimepicker: true,
timezoneIso8601: false,
timezoneList: null,
addSliderAccess: false,
sliderAccessArgs: null,
controlType: 'slider',
- defaultValue: null
+ defaultValue: null,
+ parse: 'strict'
};
$.extend(this._defaults, this.regional['']);
}
@@ -210,7 +213,7 @@
// controlType is string - key to our this._controls
if(typeof(tp_inst._defaults.controlType) === 'string'){
- if(tp_inst._defaults.controlType == 'slider' && $.fn.slider === undefined){
+ if($.fn[tp_inst._defaults.controlType] === undefined){
tp_inst._defaults.controlType = 'select';
}
tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
@@ -304,6 +307,10 @@
}
$.extend(this, parseRes.timeObj);
} catch (err) {
+ $.datepicker.log("Error parsing the date/time string: " + err +
+ "\ndate/time string = " + timeString +
+ "\ntimeFormat = " + this._defaults.timeFormat +
+ "\ndateFormat = " + dp_dateFormat);
return false;
}
return true;
@@ -355,21 +362,7 @@
if(litem == 'hour'){
for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) {
gridSize[litem]++;
- var tmph = (o.ampm && h > 12) ? h - 12 : h;
- if (tmph < 10) {
- tmph = '0' + tmph;
- }
- if (o.ampm) {
- if (h === 0) {
- tmph = 12 + 'a';
- } else {
- if (h < 12) {
- tmph += 'a';
- } else {
- tmph += 'p';
- }
- }
- }
+ var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat)? 'hht':'HH', {hour:h}, o);
html += '<td data-for="'+litem+'">' + tmph + '</td>';
}
}
@@ -418,24 +411,22 @@
}).find("td").click(function(e){
var $t = $(this),
h = $t.html(),
+ n = parseInt(h.replace(/[^0-9]/g),10),
+ ap = h.replace(/[^apm]/ig),
f = $t.data('for'); // loses scope, so we use data-for
- if (f == 'hour' && o.ampm) {
- var ap = h.substring(2).toLowerCase(),
- aph = parseInt(h.substring(0, 2), 10);
- if (ap == 'a') {
- if (aph == 12) {
- h = 0;
- } else {
- h = aph;
+ if(f == 'hour'){
+ if(ap.indexOf('p') !== -1 && n < 12){
+ n += 12;
+ }
+ else{
+ if(ap.indexOf('a') !== -1 && n === 12){
+ n = 0;
}
- } else if (aph == 12) {
- h = 12;
- } else {
- h = aph + 12;
}
}
- tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], parseInt(h,10));
+
+ tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, n);
tp_inst._onTimeChange();
tp_inst._onSelectHandler();
@@ -629,20 +620,20 @@
millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
if (this.hour_slider) {
- this.control.options(this, this.hour_slider, { min: this._defaults.hourMin, max: hourMax });
- this.control.value(this, this.hour_slider, this.hour);
+ this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
+ this.control.value(this, this.hour_slider, 'hour', this.hour);
}
if (this.minute_slider) {
- this.control.options(this, this.minute_slider, { min: this._defaults.minuteMin, max: minMax });
- this.control.value(this, this.minute_slider, this.minute);
+ this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
+ this.control.value(this, this.minute_slider, 'minute', this.minute);
}
if (this.second_slider) {
- this.control.options(this, this.second_slider, { min: this._defaults.secondMin, max: secMax });
- this.control.value(this, this.second_slider, this.second);
+ this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
+ this.control.value(this, this.second_slider, 'second', this.second);
}
if (this.millisec_slider) {
- this.control.options(this, this.millisec_slider, { min: this._defaults.millisecMin, max: millisecMax });
- this.control.value(this, this.millisec_slider, this.millisec);
+ this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
+ this.control.value(this, this.millisec_slider, 'millisec', this.millisec);
}
}
@@ -653,12 +644,14 @@
* on time change is also called when the time is updated in the text field
*/
_onTimeChange: function() {
- var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider) : false,
- minute = (this.minute_slider) ? this.control.value(this, this.minute_slider) : false,
- second = (this.second_slider) ? this.control.value(this, this.second_slider) : false,
- millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider) : false,
+ var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
+ minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
+ second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
+ millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
timezone = (this.timezone_select) ? this.timezone_select.val() : false,
- o = this._defaults;
+ o = this._defaults,
+ pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
+ pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
if (typeof(hour) == 'object') {
hour = false;
@@ -721,14 +714,21 @@
this._limitMinMaxDateTime(this.inst, true);
}
- if (o.ampm) {
+ if (useAmpm(o.timeFormat)) {
this.ampm = ampm;
}
- this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults);
+ // Updates the time within the timepicker
+ this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
if (this.$timeObj) {
- this.$timeObj.text(this.formattedTime + o.timeSuffix);
+ if(pickerTimeFormat === o.timeFormat){
+ this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
+ }
+ else{
+ this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
+ }
}
+
this.timeDefined = true;
if (hasChanged) {
this._updateDateTime();
@@ -786,6 +786,7 @@
var altFormattedDateTime = '',
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
+
if (this._defaults.altFormat) altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
else altFormattedDateTime = this.formattedDate;
if (altFormattedDateTime) altFormattedDateTime += altSeparator;
@@ -832,7 +833,7 @@
max: rtl? min*-1 : max,
step: step,
slide: function(event, ui) {
- tp_inst.control.value(tp_inst, $(this), rtl? ui.value*-1:ui.value);
+ tp_inst.control.value(tp_inst, $(this), unit, rtl? ui.value*-1:ui.value);
tp_inst._onTimeChange();
},
stop: function(event, ui) {
@@ -840,7 +841,7 @@
}
});
},
- options: function(tp_inst, obj, opts, val){
+ options: function(tp_inst, obj, unit, opts, val){
if(tp_inst._defaults.isRTL){
if(typeof(opts) == 'string'){
if(opts == 'min' || opts == 'max'){
@@ -863,7 +864,7 @@
return obj.slider(opts, val);
return obj.slider(opts);
},
- value: function(tp_inst, obj, val){
+ value: function(tp_inst, obj, unit, val){
if(tp_inst._defaults.isRTL){
if(val !== undefined)
return obj.slider('value', val*-1);
@@ -883,13 +884,8 @@
for(var i=min; i<=max; i+=step){
sel += '<option value="'+ i +'"'+ (i==val? ' selected':'') +'>';
- if(unit == 'hour' && tp_inst._defaults.ampm){
- m = i%12;
- if(i === 0 || i === 12) sel += '12';
- else if(m < 10) sel += '0'+ m.toString();
- else sel += m;
- sel += ' '+ ((i < 12)? tp_inst._defaults.amNames[0] : tp_inst._defaults.pmNames[0])[ul]();
- }
+ if(unit == 'hour' && useAmpm(tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat))
+ sel += $.datepicker.formatTime("hh TT", {hour:i}, tp_inst._defaults);
else if(unit == 'millisec' || i >= 10) sel += i;
else sel += '0'+ i.toString();
sel += '</option>';
@@ -905,7 +901,7 @@
return obj;
},
- options: function(tp_inst, obj, opts, val){
+ options: function(tp_inst, obj, unit, opts, val){
var o = {},
$t = obj.children('select');
if(typeof(opts) == 'string'){
@@ -916,7 +912,7 @@
else o = opts;
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
},
- value: function(tp_inst, obj, val){
+ value: function(tp_inst, obj, unit, val){
var $t = obj.children('select');
if(val !== undefined)
return $t.val(val);
@@ -987,139 +983,172 @@
/*
* Public utility to parse time
*/
- $.datepicker.parseTime = function(timeFormat, timeString, options) {
-
- // pattern for standard and localized AM/PM markers
- var getPatternAmpm = function(amNames, pmNames) {
- var markers = [];
- if (amNames) {
- $.merge(markers, amNames);
- }
- if (pmNames) {
- $.merge(markers, pmNames);
- }
- markers = $.map(markers, function(val) {
- return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
- });
- return '(' + markers.join('|') + ')?';
- };
+ $.datepicker.parseTime = function(timeFormat, timeString, options) {
+ var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
- // figure out position of time elements.. cause js cant do named captures
- var getFormatPositions = function(timeFormat) {
- var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
- orders = {
- h: -1,
- m: -1,
- s: -1,
- l: -1,
- t: -1,
- z: -1
- };
+ // Strict parse requires the timeString to match the timeFormat exactly
+ var strictParse = function(f, s, o){
- if (finds) {
- for (var i = 0; i < finds.length; i++) {
- if (orders[finds[i].toString().charAt(0)] == -1) {
- orders[finds[i].toString().charAt(0)] = i + 1;
- }
+ // pattern for standard and localized AM/PM markers
+ var getPatternAmpm = function(amNames, pmNames) {
+ var markers = [];
+ if (amNames) {
+ $.merge(markers, amNames);
}
- }
- return orders;
- };
-
- var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
+ if (pmNames) {
+ $.merge(markers, pmNames);
+ }
+ markers = $.map(markers, function(val) {
+ return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
+ });
+ return '(' + markers.join('|') + ')?';
+ };
- var regstr = '^' + timeFormat.toString()
- .replace(/(hh?|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
- switch (match.charAt(0).toLowerCase()) {
- case 'h': return '(\\d?\\d)';
- case 'm': return '(\\d?\\d)';
- case 's': return '(\\d?\\d)';
- case 'l': return '(\\d?\\d?\\d)';
- case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
- case 't': return getPatternAmpm(o.amNames, o.pmNames);
- default: // literal escaped in quotes
- return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
+ // figure out position of time elements.. cause js cant do named captures
+ var getFormatPositions = function(timeFormat) {
+ var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
+ orders = {
+ h: -1,
+ m: -1,
+ s: -1,
+ l: -1,
+ t: -1,
+ z: -1
+ };
+
+ if (finds) {
+ for (var i = 0; i < finds.length; i++) {
+ if (orders[finds[i].toString().charAt(0)] == -1) {
+ orders[finds[i].toString().charAt(0)] = i + 1;
}
- })
- .replace(/\s/g, '\\s?') +
- o.timeSuffix + '$',
- order = getFormatPositions(timeFormat),
- ampm = '',
- treg;
-
- treg = timeString.match(new RegExp(regstr, 'i'));
+ }
+ }
+ return orders;
+ };
- var resTime = {
- hour: 0,
- minute: 0,
- second: 0,
- millisec: 0
- };
+ var regstr = '^' + f.toString()
+ .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
+ switch (match.charAt(0).toLowerCase()) {
+ case 'h': return '(\\d?\\d)';
+ case 'm': return '(\\d?\\d)';
+ case 's': return '(\\d?\\d)';
+ case 'l': return '(\\d?\\d?\\d)';
+ case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
+ case 't': return getPatternAmpm(o.amNames, o.pmNames);
+ default: // literal escaped in quotes
+ return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
+ }
+ })
+ .replace(/\s/g, '\\s?') +
+ o.timeSuffix + '$',
+ order = getFormatPositions(f),
+ ampm = '',
+ treg;
+
+ treg = s.match(new RegExp(regstr, 'i'));
+
+ var resTime = {
+ hour: 0,
+ minute: 0,
+ second: 0,
+ millisec: 0
+ };
- if (treg) {
- if (order.t !== -1) {
- if (treg[order.t] === undefined || treg[order.t].length === 0) {
- ampm = '';
- resTime.ampm = '';
- } else {
- ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
- resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
+ if (treg) {
+ if (order.t !== -1) {
+ if (treg[order.t] === undefined || treg[order.t].length === 0) {
+ ampm = '';
+ resTime.ampm = '';
+ } else {
+ ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
+ resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
+ }
}
- }
- if (order.h !== -1) {
- if (ampm == 'AM' && treg[order.h] == '12') {
- resTime.hour = 0; // 12am = 0 hour
- } else {
- if (ampm == 'PM' && treg[order.h] != '12') {
- resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
+ if (order.h !== -1) {
+ if (ampm == 'AM' && treg[order.h] == '12') {
+ resTime.hour = 0; // 12am = 0 hour
} else {
- resTime.hour = Number(treg[order.h]);
+ if (ampm == 'PM' && treg[order.h] != '12') {
+ resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
+ } else {
+ resTime.hour = Number(treg[order.h]);
+ }
}
}
- }
- if (order.m !== -1) {
- resTime.minute = Number(treg[order.m]);
- }
- if (order.s !== -1) {
- resTime.second = Number(treg[order.s]);
- }
- if (order.l !== -1) {
- resTime.millisec = Number(treg[order.l]);
- }
- if (order.z !== -1 && treg[order.z] !== undefined) {
- var tz = treg[order.z].toUpperCase();
- switch (tz.length) {
- case 1:
- // Z
- tz = o.timezoneIso8601 ? 'Z' : '+0000';
- break;
- case 5:
- // +hhmm
- if (o.timezoneIso8601) {
- tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':' + tz.substring(3);
- }
- break;
- case 6:
- // +hh:mm
- if (!o.timezoneIso8601) {
- tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000' : tz.replace(/:/, '');
- } else {
- if (tz.substring(1) == '00:00') {
- tz = 'Z';
+ if (order.m !== -1) {
+ resTime.minute = Number(treg[order.m]);
+ }
+ if (order.s !== -1) {
+ resTime.second = Number(treg[order.s]);
+ }
+ if (order.l !== -1) {
+ resTime.millisec = Number(treg[order.l]);
+ }
+ if (order.z !== -1 && treg[order.z] !== undefined) {
+ var tz = treg[order.z].toUpperCase();
+ switch (tz.length) {
+ case 1:
+ // Z
+ tz = o.timezoneIso8601 ? 'Z' : '+0000';
+ break;
+ case 5:
+ // +hhmm
+ if (o.timezoneIso8601) {
+ tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':' + tz.substring(3);
+ }
+ break;
+ case 6:
+ // +hh:mm
+ if (!o.timezoneIso8601) {
+ tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000' : tz.replace(/:/, '');
+ } else {
+ if (tz.substring(1) == '00:00') {
+ tz = 'Z';
+ }
}
+ break;
}
- break;
+ resTime.timezone = tz;
}
- resTime.timezone = tz;
- }
- return resTime;
- }
+ return resTime;
+ }
+ return false;
+ };// end strictParse
- return false;
+ // First try JS Date, if that fails, use strictParse
+ var looseParse = function(f,s,o){
+ try{
+ var d = new Date('2012-01-01 '+ s);
+ return {
+ hour: d.getHours(),
+ minutes: d.getMinutes(),
+ seconds: d.getSeconds(),
+ millisec: d.getMilliseconds(),
+ timezone: $.timepicker.timeZoneOffsetString(d)
+ };
+ }
+ catch(err){
+ try{
+ return strictParse(f,s,o);
+ }
+ catch(err2){
+ $.datepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
+ }
+ }
+ return false;
+ }; // end looseParse
+
+ if(typeof o.parse === "function"){
+ return o.parse(timeFormat, timeString, o)
+ }
+ if(o.parse === 'loose'){
+ return looseParse(timeFormat, timeString, o);
+ }
+ return strictParse(timeFormat, timeString, o);
};
/*
@@ -1139,27 +1168,24 @@
timezone: '+0000'
}, time);
- var tmptime = format;
- var ampmName = options.amNames[0];
+ var tmptime = format,
+ ampmName = options.amNames[0],
+ hour = parseInt(time.hour, 10);
- var hour = parseInt(time.hour, 10);
- if (options.ampm) {
- if (hour > 11) {
- ampmName = options.pmNames[0];
- if (hour > 12) {
- hour = hour % 12;
- }
- }
- if (hour === 0) {
- hour = 12;
- }
+ if (hour > 11) {
+ ampmName = options.pmNames[0];
}
- tmptime = tmptime.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function(match) {
- switch (match.toLowerCase()) {
- case 'hh':
+
+ tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[lz]|('.*?'|".*?"))/g, function(match) {
+ switch (match) {
+ case 'HH':
return ('0' + hour).slice(-2);
- case 'h':
+ case 'H':
return hour;
+ case 'hh':
+ return convert24to12(hour).slice(-2);
+ case 'h':
+ return convert24to12(hour);
case 'mm':
return ('0' + time.minute).slice(-2);
case 'm':
@@ -1172,15 +1198,14 @@
return ('00' + time.millisec).slice(-3);
case 'z':
return time.timezone === null? options.defaultTimezone : time.timezone;
+ case 'T':
+ return ampmName.charAt(0).toUpperCase();
+ case 'TT':
+ return ampmName.toUpperCase();
case 't':
+ return ampmName.charAt(0).toLowerCase();
case 'tt':
- if (options.ampm) {
- if (match.length == 1) {
- ampmName = ampmName.charAt(0);
- }
- return match.charAt(0) === 'T' ? ampmName.toUpperCase() : ampmName.toLowerCase();
- }
- return '';
+ return ampmName.toLowerCase();
default:
return match.replace(/\'/g, "") || "'";
}
@@ -1253,7 +1278,7 @@
if (tp_inst) {
if ($.datepicker._get(inst, 'constrainInput')) {
- var ampm = tp_inst._defaults.ampm,
+ var ampm = useAmpm(tp_inst._defaults.timeFormat),
dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
datetimeChars = tp_inst._defaults.timeFormat.toString()
.replace(/[hms]/g, '')
@@ -1292,7 +1317,7 @@
altFormattedDateTime = '',
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
- altTimeFormat = tp_inst._defaults.altTimeFormat !== undefined ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
+ altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
if(!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly){
@@ -1487,6 +1512,7 @@
// the "extra" characters. We rely on that instead of
// attempting to perfectly reproduce the parsing algorithm.
date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
+ $.datepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
}
return date;
};
@@ -1590,7 +1616,7 @@
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
* it will return false for all objects
*/
- function isEmptyObject (obj) {
+ var isEmptyObject = function(obj) {
var prop;
for (prop in obj) {
if (obj.hasOwnProperty(obj)) {
@@ -1598,11 +1624,12 @@
}
}
return true;
- }
+ };
+
/*
* jQuery extend now ignores nulls!
*/
- function extendRemove(target, props) {
+ var extendRemove = function(target, props) {
$.extend(target, props);
for (var name in props) {
if (props[name] === null || props[name] === undefined) {
@@ -1610,7 +1637,35 @@
}
}
return target;
- }
+ };
+
+ /*
+ * Determine by the time format if should use ampm
+ * Returns true if should use ampm, false if not
+ */
+ var useAmpm = function(timeFormat){
+ return (timeFormat.indexOf('t') !== -1 && timeFormat.indexOf('h') !== -1);
+ };
+
+ /*
+ * Converts 24 hour format into 12 hour
+ * Returns 12 hour with leading 0
+ */
+ var convert24to12 = function(hour) {
+ if (hour > 12) {
+ hour = hour - 12;
+ }
+
+ if (hour == 0) {
+ hour = 12;
+ }
+
+ if (hour < 10) {
+ hour = "0" + hour;
+ }
+
+ return String(hour);
+ };
/*
* Splits datetime string into date ans time substrings.
@@ -1623,18 +1678,11 @@
// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator,
format = timeSettings && timeSettings.timeFormat ? timeSettings.timeFormat : $.timepicker._defaults.timeFormat,
- ampm = timeSettings && timeSettings.ampm ? timeSettings.ampm : $.timepicker._defaults.ampm,
timeParts = format.split(separator), // how many occurances of separator may be in our format?
timePartsLen = timeParts.length,
allParts = dateTimeString.split(separator),
allPartsLen = allParts.length;
- // because our default ampm=false, but our default format has tt, we need to filter this out
- if(!ampm){
- timeParts = $.trim(format.replace(/t/gi,'')).split(separator);
- timePartsLen = timeParts.length;
- }
-
if (allPartsLen > 1) {
return [
allParts.splice(0,allPartsLen-timePartsLen).join(separator),
@@ -1643,6 +1691,13 @@
}
} catch (err) {
+ $.datepicker.log('Could not split the date from the time. Please check the following datetimepicker options' +
+ "\nthrown error: " + err +
+ "\ndateTimeString" + dateTimeString +
+ "\ndateFormat = " + dateFormat +
+ "\nseparator = " + timeSettings.separator +
+ "\ntimeFormat = " + timeSettings.timeFormat);
+
if (err.indexOf(":") >= 0) {
// Hack! The error message ends with a colon, a space, and
// the "extra" characters. We rely on that instead of
@@ -1826,6 +1881,6 @@
/*
* Keep up with the version
*/
- $.timepicker.version = "1.0.5";
+ $.timepicker.version = "1.1.0";
-})(jQuery); \ No newline at end of file
+})(jQuery);
diff --git a/localization/jquery-ui-timepicker-af.js b/localization/jquery-ui-timepicker-af.js
index 0ad850a..6a6353e 100644
--- a/localization/jquery-ui-timepicker-af.js
+++ b/localization/jquery-ui-timepicker-af.js
@@ -11,10 +11,9 @@
timezoneText: 'Tydsone',
currentText: 'Huidige Tyd',
closeText: 'Klaar',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['af']);
diff --git a/localization/jquery-ui-timepicker-bg.js b/localization/jquery-ui-timepicker-bg.js
index 1ccf6db..ffc0cea 100644
--- a/localization/jquery-ui-timepicker-bg.js
+++ b/localization/jquery-ui-timepicker-bg.js
@@ -11,10 +11,9 @@
timezoneText: 'Часови пояс',
currentText: 'Сега',
closeText: 'Затвори',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['bg']);
diff --git a/localization/jquery-ui-timepicker-ca.js b/localization/jquery-ui-timepicker-ca.js
index 3551130..e3c771d 100644
--- a/localization/jquery-ui-timepicker-ca.js
+++ b/localization/jquery-ui-timepicker-ca.js
@@ -11,10 +11,9 @@
timezoneText: 'Fus horari',
currentText: 'Ara',
closeText: 'Tancar',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ca']);
diff --git a/localization/jquery-ui-timepicker-cs.js b/localization/jquery-ui-timepicker-cs.js
index 3c14875..8b31e6b 100644
--- a/localization/jquery-ui-timepicker-cs.js
+++ b/localization/jquery-ui-timepicker-cs.js
@@ -11,10 +11,9 @@
timezoneText: 'Časové pásmo',
currentText: 'Nyní',
closeText: 'Zavřít',
- timeFormat: 'h:m',
+ timeFormat: 'H:m',
amNames: ['dop.', 'AM', 'A'],
pmNames: ['odp.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['cs']);
diff --git a/localization/jquery-ui-timepicker-de.js b/localization/jquery-ui-timepicker-de.js
index ebf76c1..1a998a0 100644
--- a/localization/jquery-ui-timepicker-de.js
+++ b/localization/jquery-ui-timepicker-de.js
@@ -11,10 +11,9 @@
timezoneText: 'Zeitzone',
currentText: 'Jetzt',
closeText: 'Fertig',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['vorm.', 'AM', 'A'],
pmNames: ['nachm.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['de']);
diff --git a/localization/jquery-ui-timepicker-el.js b/localization/jquery-ui-timepicker-el.js
index b475a62..9109afd 100644
--- a/localization/jquery-ui-timepicker-el.js
+++ b/localization/jquery-ui-timepicker-el.js
@@ -11,10 +11,9 @@
timezoneText: 'Ζώνη ώρας',
currentText: 'Τώρα',
closeText: 'Κλείσιμο',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['π.μ.', 'AM', 'A'],
pmNames: ['μ.μ.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['el']);
diff --git a/localization/jquery-ui-timepicker-es.js b/localization/jquery-ui-timepicker-es.js
index d1cfc9a..c446c1c 100644
--- a/localization/jquery-ui-timepicker-es.js
+++ b/localization/jquery-ui-timepicker-es.js
@@ -11,10 +11,9 @@
timezoneText: 'Huso horario',
currentText: 'Ahora',
closeText: 'Cerrar',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['a.m.', 'AM', 'A'],
pmNames: ['p.m.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['es']);
diff --git a/localization/jquery-ui-timepicker-et.js b/localization/jquery-ui-timepicker-et.js
index 8417690..a3a4f10 100644
--- a/localization/jquery-ui-timepicker-et.js
+++ b/localization/jquery-ui-timepicker-et.js
@@ -11,10 +11,9 @@
timezoneText: 'Ajavöönd',
currentText: 'Praegu',
closeText: 'Valmis',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['et']);
diff --git a/localization/jquery-ui-timepicker-fi.js b/localization/jquery-ui-timepicker-fi.js
index d21b781..12be648 100644
--- a/localization/jquery-ui-timepicker-fi.js
+++ b/localization/jquery-ui-timepicker-fi.js
@@ -11,10 +11,9 @@
timezoneText: 'Aikavyöhyke',
currentText: 'Nyt',
closeText: 'Sulje',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['ap.', 'AM', 'A'],
pmNames: ['ip.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['fi']);
diff --git a/localization/jquery-ui-timepicker-fr.js b/localization/jquery-ui-timepicker-fr.js
index c2315b5..805b72d 100644
--- a/localization/jquery-ui-timepicker-fr.js
+++ b/localization/jquery-ui-timepicker-fr.js
@@ -11,10 +11,9 @@
timezoneText: 'Fuseau horaire',
currentText: 'Maintenant',
closeText: 'Terminé',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['fr']);
diff --git a/localization/jquery-ui-timepicker-gl.js b/localization/jquery-ui-timepicker-gl.js
index 2717bcc..4ed889b 100644
--- a/localization/jquery-ui-timepicker-gl.js
+++ b/localization/jquery-ui-timepicker-gl.js
@@ -11,10 +11,9 @@
timezoneText: 'Fuso horario',
currentText: 'Agora',
closeText: 'Pechar',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['a.m.', 'AM', 'A'],
pmNames: ['p.m.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['gl']);
diff --git a/localization/jquery-ui-timepicker-he.js b/localization/jquery-ui-timepicker-he.js
index 429f84a..a887fbb 100644
--- a/localization/jquery-ui-timepicker-he.js
+++ b/localization/jquery-ui-timepicker-he.js
@@ -11,10 +11,9 @@
timezoneText: "אזור זמן",
currentText: "עכשיו",
closeText:"סגור",
- timeFormat: "hh:mm tt",
+ timeFormat: "HH:mm",
amNames: ['לפנה"צ', 'AM', 'A'],
pmNames: ['אחה"צ', 'PM', 'P'],
- ampm: false,
isRTL: true
};
$.timepicker.setDefaults($.timepicker.regional["he"]);
diff --git a/localization/jquery-ui-timepicker-hu.js b/localization/jquery-ui-timepicker-hu.js
index af84b5f..1adb8a9 100644
--- a/localization/jquery-ui-timepicker-hu.js
+++ b/localization/jquery-ui-timepicker-hu.js
@@ -11,10 +11,9 @@
timezoneText: 'Időzóna',
currentText: 'Most',
closeText: 'Kész',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['de.', 'AM', 'A'],
pmNames: ['du.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['hu']);
diff --git a/localization/jquery-ui-timepicker-id.js b/localization/jquery-ui-timepicker-id.js
index 7645f13..6c0e858 100644
--- a/localization/jquery-ui-timepicker-id.js
+++ b/localization/jquery-ui-timepicker-id.js
@@ -11,10 +11,9 @@
timezoneText: 'Zona Waktu',
currentText: 'Sekarang',
closeText: 'OK',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['id']);
diff --git a/localization/jquery-ui-timepicker-it.js b/localization/jquery-ui-timepicker-it.js
index 10b2ab4..70124fd 100644
--- a/localization/jquery-ui-timepicker-it.js
+++ b/localization/jquery-ui-timepicker-it.js
@@ -11,10 +11,9 @@
timezoneText: 'Fuso orario',
currentText: 'Adesso',
closeText: 'Chiudi',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['m.', 'AM', 'A'],
pmNames: ['p.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['it']);
diff --git a/localization/jquery-ui-timepicker-ja.js b/localization/jquery-ui-timepicker-ja.js
index cd267e3..42d8114 100644
--- a/localization/jquery-ui-timepicker-ja.js
+++ b/localization/jquery-ui-timepicker-ja.js
@@ -11,10 +11,9 @@
timezoneText: 'タイムゾーン',
currentText: '現時刻',
closeText: '閉じる',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['午前', 'AM', 'A'],
pmNames: ['午後', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ja']);
diff --git a/localization/jquery-ui-timepicker-ko.js b/localization/jquery-ui-timepicker-ko.js
index c238d87..7fe6c47 100644
--- a/localization/jquery-ui-timepicker-ko.js
+++ b/localization/jquery-ui-timepicker-ko.js
@@ -14,7 +14,6 @@
timeFormat: 'tt h:mm',
amNames: ['오전', 'AM', 'A'],
pmNames: ['오후', 'PM', 'P'],
- ampm: true,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ko']);
diff --git a/localization/jquery-ui-timepicker-lt.js b/localization/jquery-ui-timepicker-lt.js
index 662b639..4ec3eeb 100644
--- a/localization/jquery-ui-timepicker-lt.js
+++ b/localization/jquery-ui-timepicker-lt.js
@@ -11,10 +11,9 @@
timezoneText: 'Laiko zona',
currentText: 'Dabar',
closeText: 'Uždaryti',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['priešpiet', 'AM', 'A'],
pmNames: ['popiet', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['lt']);
diff --git a/localization/jquery-ui-timepicker-nl.js b/localization/jquery-ui-timepicker-nl.js
index b31b89a..eff496c 100644
--- a/localization/jquery-ui-timepicker-nl.js
+++ b/localization/jquery-ui-timepicker-nl.js
@@ -11,10 +11,9 @@
timezoneText: 'Tijdzone',
currentText: 'Vandaag',
closeText: 'Sluiten',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['nl']);
diff --git a/localization/jquery-ui-timepicker-no.js b/localization/jquery-ui-timepicker-no.js
index 9997345..8da6a1d 100644
--- a/localization/jquery-ui-timepicker-no.js
+++ b/localization/jquery-ui-timepicker-no.js
@@ -11,10 +11,9 @@
timezoneText: 'Tidssone',
currentText: 'Nå',
closeText: 'Lukk',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['am', 'AM', 'A'],
pmNames: ['pm', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['no']);
diff --git a/localization/jquery-ui-timepicker-pl.js b/localization/jquery-ui-timepicker-pl.js
index 16dab12..138b7d3 100644
--- a/localization/jquery-ui-timepicker-pl.js
+++ b/localization/jquery-ui-timepicker-pl.js
@@ -11,10 +11,9 @@
timezoneText: 'Strefa czasowa',
currentText: 'Teraz',
closeText: 'Gotowe',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['pl']);
diff --git a/localization/jquery-ui-timepicker-pt-BR.js b/localization/jquery-ui-timepicker-pt-BR.js
index ea86993..104b353 100644
--- a/localization/jquery-ui-timepicker-pt-BR.js
+++ b/localization/jquery-ui-timepicker-pt-BR.js
@@ -11,10 +11,9 @@
timezoneText: 'Fuso horrio',
currentText: 'Agora',
closeText: 'Fechar',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['a.m.', 'AM', 'A'],
pmNames: ['p.m.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['pt-BR']);
diff --git a/localization/jquery-ui-timepicker-pt.js b/localization/jquery-ui-timepicker-pt.js
index c9b05bb..029926a 100644
--- a/localization/jquery-ui-timepicker-pt.js
+++ b/localization/jquery-ui-timepicker-pt.js
@@ -11,10 +11,9 @@
timezoneText: 'Fuso horário',
currentText: 'Agora',
closeText: 'Fechar',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['a.m.', 'AM', 'A'],
pmNames: ['p.m.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['pt']);
diff --git a/localization/jquery-ui-timepicker-ro.js b/localization/jquery-ui-timepicker-ro.js
index 0224bdb..2b80a02 100644
--- a/localization/jquery-ui-timepicker-ro.js
+++ b/localization/jquery-ui-timepicker-ro.js
@@ -11,10 +11,9 @@
timezoneText: 'Fus orar',
currentText: 'Acum',
closeText: 'Închide',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ro']);
diff --git a/localization/jquery-ui-timepicker-ru.js b/localization/jquery-ui-timepicker-ru.js
index 4469a11..71ea9d5 100644
--- a/localization/jquery-ui-timepicker-ru.js
+++ b/localization/jquery-ui-timepicker-ru.js
@@ -11,10 +11,9 @@
timezoneText: 'Часовой пояс',
currentText: 'Сейчас',
closeText: 'Закрыть',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ru']);
diff --git a/localization/jquery-ui-timepicker-sk.js b/localization/jquery-ui-timepicker-sk.js
index 8c57fb7..4b4042b 100644
--- a/localization/jquery-ui-timepicker-sk.js
+++ b/localization/jquery-ui-timepicker-sk.js
@@ -11,10 +11,9 @@
timezoneText: 'Časové pásmo',
currentText: 'Teraz',
closeText: 'Zavrieť',
- timeFormat: 'h:m',
+ timeFormat: 'H:m',
amNames: ['dop.', 'AM', 'A'],
pmNames: ['pop.', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['sk']);
diff --git a/localization/jquery-ui-timepicker-sv.js b/localization/jquery-ui-timepicker-sv.js
index d5a123e..167d2f6 100644
--- a/localization/jquery-ui-timepicker-sv.js
+++ b/localization/jquery-ui-timepicker-sv.js
@@ -11,10 +11,9 @@
timezoneText: 'Tidszon',
currentText: 'Nu',
closeText: 'Stäng',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['sv']);
diff --git a/localization/jquery-ui-timepicker-tr.js b/localization/jquery-ui-timepicker-tr.js
index bc054b2..dcbf96d 100644
--- a/localization/jquery-ui-timepicker-tr.js
+++ b/localization/jquery-ui-timepicker-tr.js
@@ -11,10 +11,9 @@
timezoneText: 'Zaman Dilimi',
currentText: 'Şu an',
closeText: 'Tamam',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['ÖÖ', 'Ö'],
pmNames: ['ÖS', 'S'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['tr']);
diff --git a/localization/jquery-ui-timepicker-uk.js b/localization/jquery-ui-timepicker-uk.js
index d6830d8..badcbbd 100644
--- a/localization/jquery-ui-timepicker-uk.js
+++ b/localization/jquery-ui-timepicker-uk.js
@@ -11,10 +11,9 @@
timezoneText: 'Часовий пояс',
currentText: 'Зараз',
closeText: 'Закрити',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['uk']);
diff --git a/localization/jquery-ui-timepicker-vi.js b/localization/jquery-ui-timepicker-vi.js
index 1116f9d..93e6bfc 100644
--- a/localization/jquery-ui-timepicker-vi.js
+++ b/localization/jquery-ui-timepicker-vi.js
@@ -11,10 +11,9 @@
timezoneText: 'Múi giờ',
currentText: 'Hiện thời',
closeText: 'Đóng',
- timeFormat: 'h:m',
+ timeFormat: 'H:m',
amNames: ['SA', 'AM', 'A'],
pmNames: ['CH', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['vi']);
diff --git a/localization/jquery-ui-timepicker-zh-CN.js b/localization/jquery-ui-timepicker-zh-CN.js
index a5af91b..16ca718 100644
--- a/localization/jquery-ui-timepicker-zh-CN.js
+++ b/localization/jquery-ui-timepicker-zh-CN.js
@@ -11,10 +11,9 @@
timezoneText: '时区',
currentText: '现在时间',
closeText: '关闭',
- timeFormat: 'hh:mm',
+ timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['zh-CN']);
diff --git a/localization/jquery-ui-timepicker-zh-TW.js b/localization/jquery-ui-timepicker-zh-TW.js
index e8e6ba8..ff1ccad 100644
--- a/localization/jquery-ui-timepicker-zh-TW.js
+++ b/localization/jquery-ui-timepicker-zh-TW.js
@@ -11,10 +11,9 @@
timezoneText: '時區',
currentText: '現在時間',
closeText: '確定',
- timeFormat: 'hh:mm tt',
+ timeFormat: 'HH:mm',
amNames: ['上午', 'AM', 'A'],
pmNames: ['下午', 'PM', 'P'],
- ampm: false,
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['zh-TW']);