You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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>
<dd><em>Default: "Done", A Localization Setting</em> - Text for the Close button.</dd>
151
151
152
-
<dt>ampm</dt>
153
-
<dd><em>Default: false, A Localization Setting</em> - Whether or not to use am/pm calculations.</dd>
154
-
155
152
<dt>amNames</dt>
156
153
<dd><em>Default: ['AM', 'A'], A Localization Setting</em> - Array of strings to try and parse against to determine AM.</dd>
157
154
158
155
<dt>pmNames</dt>
159
156
<dd><em>Default: ['PM', 'P'], A Localization Setting</em> - Array of strings to try and parse against to determine PM.</dd>
160
157
161
158
<dt>timeFormat</dt>
162
-
<dd><em>Default: "hh:mm tt", A Localization Setting</em> - String of format tokens to be replaced with the time. <ahref="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
159
+
<dd><em>Default: "HH:mm", A Localization Setting</em> - String of format tokens to be replaced with the time. <ahref="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
163
160
164
161
<dt>timeSuffix</dt>
165
162
<dd><em>Default: "", A Localization Setting</em> - String to place after the formatted time.</dd>
@@ -225,7 +222,19 @@ <h3>Time Field Options</h3>
225
222
<dlclass="defs">
226
223
227
224
<dt>controlType</dt>
228
-
<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>
225
+
<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.
226
+
<pre>{
227
+
create: function(tp_inst, obj, unit, val, min, max, step){
228
+
// generate whatever controls you want here, just return obj
229
+
},
230
+
options: function(tp_inst, obj, unit, opts, val){
231
+
// if val==undefined return the value, else return obj
232
+
},
233
+
value: function(tp_inst, obj, unit, val){
234
+
// if val==undefined return the value, else return obj
235
+
}
236
+
}</pre>
237
+
</dd>
229
238
230
239
<dt>showHour</dt>
231
240
<dd><em>Default: true</em> - Whether to show the hour slider.</dd>
@@ -326,6 +335,12 @@ <h3>Other Options</h3>
326
335
<dt>separator</dt>
327
336
<dd><em>Default: " "</em> - When formatting the time this string is placed between the formatted date and formatted time.</dd>
328
337
338
+
<dt>pickerTimeFormat</dt>
339
+
<dd><em>Default: (timeFormat option)</em> - How to format the time displayed within the timepicker.</dd>
340
+
341
+
<dt>pickerTimeSuffix</dt>
342
+
<dd><em>Default: (timeSuffix option)</em> - String to place after the formatted time within the timepicker.</dd>
343
+
329
344
<dt>showTimepicker</dt>
330
345
<dd><em>Default: true</em> - Whether to show the timepicker within the datepicker.</dd>
331
346
@@ -343,6 +358,17 @@ <h3>Other Options</h3>
343
358
344
359
<dt>maxDateTime</dt>
345
360
<dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
361
+
362
+
<dt>parse</dt>
363
+
<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:
364
+
<pre>{
365
+
hour: 19,
366
+
minutes: 10,
367
+
seconds: 23,
368
+
millisec: 45,
369
+
timezone: '-0400'
370
+
}</pre>
371
+
</dd>
346
372
</dl>
347
373
348
374
</div>
@@ -355,11 +381,13 @@ <h3>Other Options</h3>
355
381
356
382
<h2>Formatting Your Time</h2>
357
383
358
-
<p>The default format is "hh:mm tt", however ampm is turned off by default, so you will see "hh:mm"</p>
384
+
<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>
359
385
360
386
<dlclass="defs">
361
-
<dt>h</dt><dd>Hour with no leading 0</dd>
362
-
<dt>hh</dt><dd>Hour with leading 0</dd>
387
+
<dt>H</dt><dd>Hour with no leading 0 (24 hour)</dd>
388
+
<dt>HH</dt><dd>Hour with leading 0 (24 hour)</dd>
389
+
<dt>h</dt><dd>Hour with no leading 0 (12 hour)</dd>
<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>
0 commit comments