From 14c386506c0a42a3a1d00fc519e9728f79421215 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jordan=20Aug=C3=A9?= Date: Fri, 22 Nov 2013 14:34:41 +0100 Subject: [PATCH] third-party: added timepicker addon needed for scheduler --- third-party/timepicker-addon | 1 + third-party/timepicker-addon-1.2/README.md | 20 + .../timepicker-addon-1.2/component.json | 11 + third-party/timepicker-addon-1.2/index.html | 936 ++++++++ .../jquery-ui-sliderAccess.js | 89 + .../jquery-ui-timepicker-addon.css | 11 + .../jquery-ui-timepicker-addon.js | 1919 +++++++++++++++++ .../localization/jquery-ui-timepicker-af.js | 20 + .../localization/jquery-ui-timepicker-bg.js | 20 + .../localization/jquery-ui-timepicker-ca.js | 20 + .../localization/jquery-ui-timepicker-cs.js | 20 + .../localization/jquery-ui-timepicker-de.js | 20 + .../localization/jquery-ui-timepicker-el.js | 20 + .../localization/jquery-ui-timepicker-es.js | 20 + .../localization/jquery-ui-timepicker-et.js | 20 + .../localization/jquery-ui-timepicker-eu.js | 20 + .../localization/jquery-ui-timepicker-fi.js | 20 + .../localization/jquery-ui-timepicker-fr.js | 20 + .../localization/jquery-ui-timepicker-gl.js | 20 + .../localization/jquery-ui-timepicker-he.js | 20 + .../localization/jquery-ui-timepicker-hu.js | 20 + .../localization/jquery-ui-timepicker-id.js | 20 + .../localization/jquery-ui-timepicker-it.js | 20 + .../localization/jquery-ui-timepicker-ja.js | 20 + .../localization/jquery-ui-timepicker-ko.js | 20 + .../localization/jquery-ui-timepicker-lt.js | 20 + .../localization/jquery-ui-timepicker-nl.js | 20 + .../localization/jquery-ui-timepicker-no.js | 20 + .../localization/jquery-ui-timepicker-pl.js | 20 + .../jquery-ui-timepicker-pt-BR.js | 20 + .../localization/jquery-ui-timepicker-pt.js | 20 + .../localization/jquery-ui-timepicker-ro.js | 20 + .../localization/jquery-ui-timepicker-ru.js | 20 + .../localization/jquery-ui-timepicker-sk.js | 20 + .../localization/jquery-ui-timepicker-sv.js | 20 + .../localization/jquery-ui-timepicker-th.js | 17 + .../localization/jquery-ui-timepicker-tr.js | 20 + .../localization/jquery-ui-timepicker-uk.js | 20 + .../localization/jquery-ui-timepicker-vi.js | 20 + .../jquery-ui-timepicker-zh-CN.js | 20 + .../jquery-ui-timepicker-zh-TW.js | 20 + 41 files changed, 3664 insertions(+) create mode 120000 third-party/timepicker-addon create mode 100644 third-party/timepicker-addon-1.2/README.md create mode 100644 third-party/timepicker-addon-1.2/component.json create mode 100644 third-party/timepicker-addon-1.2/index.html create mode 100644 third-party/timepicker-addon-1.2/jquery-ui-sliderAccess.js create mode 100644 third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.css create mode 100644 third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-af.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-bg.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-ca.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-cs.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-de.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-el.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-es.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-et.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-eu.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-fi.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-fr.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-gl.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-he.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-hu.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-id.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-it.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-ja.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-ko.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-lt.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-nl.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-no.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-pl.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-pt-BR.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-pt.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-ro.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-ru.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-sk.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-sv.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-th.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-tr.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-uk.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-vi.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-zh-CN.js create mode 100644 third-party/timepicker-addon-1.2/localization/jquery-ui-timepicker-zh-TW.js diff --git a/third-party/timepicker-addon b/third-party/timepicker-addon new file mode 120000 index 00000000..c09963d1 --- /dev/null +++ b/third-party/timepicker-addon @@ -0,0 +1 @@ +timepicker-addon-1.2 \ No newline at end of file diff --git a/third-party/timepicker-addon-1.2/README.md b/third-party/timepicker-addon-1.2/README.md new file mode 100644 index 00000000..62907c4c --- /dev/null +++ b/third-party/timepicker-addon-1.2/README.md @@ -0,0 +1,20 @@ +jQuery Timepicker Addon +======================= + +About +----- +- Author: [Trent Richardson](http://trentrichardson.com) +- Documentation: [http://trentrichardson.com/examples/timepicker/](http://trentrichardson.com/examples/timepicker/) +- Twitter: [@practicalweb](http://twitter.com/practicalweb) + +Use +--- +- To use this plugin you must include jQuery and jQuery UI with datepicker and slider +- Include timepicker-addon script +- now use timepicker with $('#selector').datetimepicker() or $('#selector').timepicker() + +Contributing Code - Please Read! +-------------------------------- +- All code contributions and bug reports are much appreciated. +- Please be sure to apply your fixes to the "dev" branch. +- Also note tabs are appreciated over spaces. \ No newline at end of file diff --git a/third-party/timepicker-addon-1.2/component.json b/third-party/timepicker-addon-1.2/component.json new file mode 100644 index 00000000..7e1fc6af --- /dev/null +++ b/third-party/timepicker-addon-1.2/component.json @@ -0,0 +1,11 @@ +{ + "name": "jquery-timepicker-addon", + "version": "1.2", + "repository": { + "type": "git", + "url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git" + }, + "dependencies": { + "jquery-ui": "~1.9.2" + } +} \ No newline at end of file diff --git a/third-party/timepicker-addon-1.2/index.html b/third-party/timepicker-addon-1.2/index.html new file mode 100644 index 00000000..2993db86 --- /dev/null +++ b/third-party/timepicker-addon-1.2/index.html @@ -0,0 +1,936 @@ + + + + + Adding a Timepicker to jQuery UI Datepicker + + + + + + + + + + + + + + + +
+

Adding a Timepicker to jQuery UI Datepicker

+ +

The timepicker addon adds a timepicker to jQuery UI Datepicker, thus the datepicker and slider components (jQueryUI) are required for using any of these. In addition all datepicker options are still available through the timepicker addon.

+ +

If you are interested in contributing to Timepicker Addon please check it out on GitHub. If you do make additions please keep in mind I enjoy tabs over spaces,.. But contributions are welcome in any form.

+ +

Back to Blog or Follow on Twitter

+ + Car BounceTry my new app to keep you informed of your car's financing status and value. + +

Donation

+

Has this Timepicker Addon been helpful to you?

+
+
+ + + + +
+
+ +
+ + + + +
+

Getting Started

+ +

Highly Recommended

+

Subscribe to my blog via email and follow @PracticalWeb on Twitter. I post for nearly every new version, so you know about updates.

+ +

Download

+

Download Timepicker Addon

+

Download/Contribute on GitHub (Need the entire repo? Find a bug? See if its fixed here)

+

There is a small bit of required CSS (Download):

+
/* css for timepicker */
+.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
+.ui-timepicker-div dl { text-align: left; }
+.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
+.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
+.ui-timepicker-div td { font-size: 90%; }
+.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
+
+.ui-timepicker-rtl{ direction: rtl; }
+.ui-timepicker-rtl dl { text-align: right; }
+.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
+
+ +

Requirements

+

You also need to include jQuery and jQuery UI with datepicker and slider wigits. You should include them in your page in the following order:

+
    +
  1. jQuery
  2. +
  3. jQueryUI (with datepicker and slider wigits)
  4. +
  5. Timepicker
  6. +
+ + +

Version

+

Version 1.2

+ +

Last updated on 02/02/2013

+

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.

+

GPL License

+

MIT License

+ +
+ + + +
+

Options

+ +

The timepicker does inherit all options from datepicker. However, there are many options that are shared by them both, and many timepicker only options:

+ +

Localization Options

+
+
currentText
+
Default: "Now", A Localization Setting - Text for the Now button.
+ +
closeText
+
Default: "Done", A Localization Setting - Text for the Close button.
+ +
amNames
+
Default: ['AM', 'A'], A Localization Setting - Array of strings to try and parse against to determine AM.
+ +
pmNames
+
Default: ['PM', 'P'], A Localization Setting - Array of strings to try and parse against to determine PM.
+ +
timeFormat
+
Default: "HH:mm", A Localization Setting - String of format tokens to be replaced with the time. See Formatting.
+ +
timeSuffix
+
Default: "", A Localization Setting - String to place after the formatted time.
+ +
timeOnlyTitle
+
Default: "Choose Time", A Localization Setting - Title of the wigit when using only timepicker.
+ +
timeText
+
Default: "Time", A Localization Setting - Label used within timepicker for the formatted time.
+ +
hourText
+
Default: "Hour", A Localization Setting - Label used to identify the hour slider.
+ +
minuteText
+
Default: "Minute", A Localization Setting - Label used to identify the minute slider.
+ +
secondText
+
Default: "Second", A Localization Setting - Label used to identify the second slider.
+ +
millisecText
+
Default: "Millisecond", A Localization Setting - Label used to identify the millisecond slider.
+ +
timezoneText
+
Default: "Timezone", A Localization Setting - Label used to identify the timezone slider.
+ +
isRTL
+
Default: false, A Localization Setting - Right to Left support.
+
+ +

Alt Field Options

+
+ +
altFieldTimeOnly
+
Default: true - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.
+ +
altSeparator
+
Default: (separator option) - String placed between formatted date and formatted time in the altField.
+ +
altTimeSuffix
+
Default: (timeSuffix option) - String always placed after the formatted time in the altField.
+ +
altTimeFormat
+
Default: (timeFormat option) - The time format to use with the altField.
+
+ +

Timezone Options

+
+ +
useLocalTimezone
+
Default: false - Whether to default timezone to the browser's set timezone.
+ +
defaultTimezone
+
Default: "+0000" - If not set, the default timezone used.
+ +
timezoneIso8601
+
Default: false - Whether to follow the ISO 8601 standard.
+ +
timezoneList
+
Default: [generated timezones] - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EST", value: "+0400" }
+
+ +

Time Field Options

+
+ +
controlType
+
Default: 'slider' - 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. +
{
+	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
+	}
+}
+
+ +
showHour
+
Default: true - Whether to show the hour slider.
+ +
showMinute
+
Default: true - Whether to show the minute slider.
+ +
showSecond
+
Default: false - Whether to show the second slider.
+ +
showMillisec
+
Default: false - Whether to show the millisecond slider.
+ +
showTimezone
+
Default: false - Whether to show the timezone select.
+ +
showTime
+
Default: true - Whether to show the time selected within the datetimepicker.
+ +
stepHour
+
Default: 1 - Hours per step the slider makes.
+ +
stepMinute
+
Default: 1 - Minutes per step the slider makes.
+ +
stepSecond
+
Default: 1 - Seconds per step the slider makes.
+ +
stepMilliSec
+
Default: 1 - Milliseconds per step the slider makes.
+ +
hour
+
Default: 0 - Initial hour set.
+ +
minute
+
Default: 0 - Initial minute set.
+ +
second
+
Default: 0 - Initial second set.
+ +
millisec
+
Default: 0 - Initial millisecond set.
+ +
timezone
+
Default: 0 - Initial timezone set.
+ +
hourMin
+
Default: 0 - The minimum hour allowed for all dates.
+ +
minuteMin
+
Default: 0 - The minimum minute allowed for all dates.
+ +
secondMin
+
Default: 0 - The minimum second allowed for all dates.
+ +
millisecMin
+
Default: 0 - The minimum millisecond allowed for all dates.
+ +
hourMax
+
Default: 23 - The maximum hour allowed for all dates.
+ +
minuteMax
+
Default: 59 - The maximum minute allowed for all dates.
+ +
secondMax
+
Default: 59 - The maximum second allowed for all dates.
+ +
millisecMax
+
Default: 999 - The maximum millisecond allowed for all dates.
+ +
hourGrid
+
Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.
+ +
minuteGrid
+
Default: 0 - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.
+ +
secondGrid
+
Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.
+ +
millisecGrid
+
Default: 0 - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.
+
+ +

Other Options

+
+
showButtonPanel
+
Default: true - Whether to show the button panel at the bottom. This is generally needed.
+ +
timeOnly
+
Default: false - Hide the datepicker and only provide a time interface.
+ +
onSelect
+
Default: null - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).
+ +
alwaysSetTime
+
Default: true - Always have a time set internally, even before user has chosen one.
+ +
separator
+
Default: " " - When formatting the time this string is placed between the formatted date and formatted time.
+ +
pickerTimeFormat
+
Default: (timeFormat option) - How to format the time displayed within the timepicker.
+ +
pickerTimeSuffix
+
Default: (timeSuffix option) - String to place after the formatted time within the timepicker.
+ +
showTimepicker
+
Default: true - Whether to show the timepicker within the datepicker.
+ +
addSliderAccess
+
Default: false - Adds the sliderAccess plugin to sliders within timepicker
+ +
sliderAccessArgs
+
Default: null - Object to pass to sliderAccess when used.
+ +
defaultValue
+
Default: null - String of the default time value placed in the input on focus when the input is empty.
+ +
minDateTime
+
Default: null - Date object of the minimum datetime allowed. Also available as minDate.
+ +
maxDateTime
+
Default: null - Date object of the maximum datetime allowed. Also Available as maxDate.
+ +
parse
+
Default: 'strict' - 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: +
{
+	hour: 19,
+	minute: 10,
+	second: 23,
+	millisec: 45,
+	timezone: '-0400'
+}
+
+
+ +
+ + + + +
+ +

Formatting Your Time

+ +

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.

+ +
+
H
Hour with no leading 0 (24 hour)
+
HH
Hour with leading 0 (24 hour)
+
h
Hour with no leading 0 (12 hour)
+
hh
Hour with leading 0 (12 hour)
+
m
Minute with no leading 0
+
mm
Minute with leading 0
+
s
Second with no leading 0
+
ss
Second with leading 0
+
l
Milliseconds always with leading 0
+
t
a or p for AM/PM
+
T
A or P for AM/PM
+
tt
am or pm for AM/PM
+
TT
AM or PM for AM/PM
+
z
Timezone as defined by timezoneList
+
'...'
Literal text (Uses single quotes)
+
+ +

Formats are used in the following ways:

+
    +
  • timeFormat option
  • +
  • altTimeFormat option
  • +
  • pickerTimeFormat option
  • +
  • $.datepicker.formatTime(format, timeObj, options) utility method
  • +
  • $.datepicker.parseTime(format, timeStr, options) utility method
  • +
+ +

For help with formatting the date portion, visit the datepicker documentation for formatting dates.

+
+ + + +
+ +

Working with Localizations

+ +

Timepicker comes with many translations and localizations, thanks to all the contributors. They can be found in the localization folder in the git repo.

+ +

The quick and cheap way to use localizations is to pass in options to a timepicker instance:

+ +
$('#example123').timepicker({
+	timeOnlyTitle: 'Выберите время',
+	timeText: 'Время',
+	hourText: 'Часы',
+	minuteText: 'Минуты',
+	secondText: 'Секунды',
+	currentText: 'Теперь',
+	closeText: 'Закрыть'
+});
+
+

However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object. As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any changes within datepicker.

+ +
$.datepicker.regional['ru'] = {
+	closeText: 'Закрыть',
+	prevText: '<Пред',
+	nextText: 'След>',
+	currentText: 'Сегодня',
+	monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
+	'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
+	monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
+	'Июл','Авг','Сен','Окт','Ноя','Дек'],
+	dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
+	dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
+	dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
+	weekHeader: 'Не',
+	dateFormat: 'dd.mm.yy',
+	firstDay: 1,
+	isRTL: false,
+	showMonthAfterYear: false,
+	yearSuffix: ''
+};
+$.datepicker.setDefaults($.datepicker.regional['ru']);
+
+
+$.timepicker.regional['ru'] = {
+	timeOnlyTitle: 'Выберите время',
+	timeText: 'Время',
+	hourText: 'Часы',
+	minuteText: 'Минуты',
+	secondText: 'Секунды',
+	millisecText: 'Миллисекунды',
+	timezoneText: 'Часовой пояс',
+	currentText: 'Сейчас',
+	closeText: 'Закрыть',
+	timeFormat: 'HH:mm',
+	amNames: ['AM', 'A'],
+	pmNames: ['PM', 'P'],
+	isRTL: false
+};
+$.timepicker.setDefaults($.timepicker.regional['ru']);
+
+

Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.

+

You can also visit localization for datepicker for more information about datepicker localizations.

+
+ + + +
+

Examples

+ + + +

Basic Initializations

+ + +
+

Add a simple datetimepicker to jQuery UI's datepicker

+
+ +
+
+$('#basic_example_1').datetimepicker();
+
+
+ + + +
+

Add only a timepicker:

+
+ +
+
+$('#basic_example_2').timepicker();
+
+
+ + +
+

Format the time:

+
+ +
+
+$('#basic_example_3').datetimepicker({
+	timeFormat: "hh:mm tt"
+});
+
+
+ +

Using Timezones

+ + +
+

Simplest timezone usage:

+
+ +
+
+$('#timezone_example_1').datetimepicker({
+	timeFormat: 'hh:mm tt z',
+	showTimezone: true
+});
+
+
+ + +
+

Define your own timezone options:

+
+ +
+
+$('#timezone_example_2').datetimepicker({
+	timeFormat: 'HH:mm z',
+	showTimezone: true,
+	timezoneList: [ 
+			{ value: '-0500', label: 'Eastern'}, 
+			{ value: '-0600', label: 'Central' }, 
+			{ value: '-0700', label: 'Mountain' }, 
+			{ value: '-0800', label: 'Pacific' } 
+		]
+});
+
+
+ + +
+

Use timezone string abbreviations for values:

+
+ +
+
+$('#timezone_example_3').datetimepicker({
+	timeFormat: 'HH:mm z',
+	showTimezone: true,
+	timezone: 'MT',
+	timezoneList: [ 
+			{ value: 'ET', label: 'Eastern'}, 
+			{ value: 'CT', label: 'Central' }, 
+			{ value: 'MT', label: 'Mountain' }, 
+			{ value: 'PT', label: 'Pacific' } 
+		]
+});
+
+
+
+ +

Slider Modifications

+ + +
+

Add a grid to each slider:

+
+ +
+
+$('#slider_example_1').timepicker({
+	hourGrid: 4,
+	minuteGrid: 10,
+	timeFormat: 'hh:mm tt'
+});
+
+
+ + +
+

Set the interval step of sliders:

+
+ +
+
+$('#slider_example_2').datetimepicker({
+	showSecond: true,
+	timeFormat: 'HH:mm:ss',
+	stepHour: 2,
+	stepMinute: 10,
+	stepSecond: 10
+});
+
+
+ + +
+

Add sliderAccess plugin for touch devices:

+
+ +
+
+$('#slider_example_3').datetimepicker({
+	addSliderAccess: true,
+	sliderAccessArgs: { touchonly: false }
+});
+
+ + +
+

Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.

+
+ +
+
+$('#slider_example_4').datetimepicker({
+	controlType: 'select',
+	timeFormat: 'hh:mm tt'
+});
+
+ + +
+

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+).

+
+ +
+
var myControl=  {
+	create: function(tp_inst, obj, unit, val, min, max, step){
+		$('<input class="ui-timepicker-input" value="'+val+'" style="width:50%">')
+			.appendTo(obj)
+			.spinner({
+				min: min,
+				max: max,
+				step: step,
+				change: function(e,ui){ // key events
+						// don't call if api was used and not key press
+						if(e.originalEvent !== undefined)
+							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
+});
+
+ +

Alternate Fields

+ + +
+

Alt field in the simplest form:

+
+ + +
+
+$('#alt_example_1').datetimepicker({
+	altField: "#alt_example_1_alt"
+});
+
+
+ + +
+

With datetime in both:

+
+ + +
+
+$('#alt_example_2').datetimepicker({
+	altField: "#alt_example_2_alt",
+	altFieldTimeOnly: false
+});
+
+
+ + +
+

Format the altField differently:

+
+ + +
+
+$('#alt_example_3').datetimepicker({
+	altField: "#alt_example_3_alt",
+	altFieldTimeOnly: false,
+	altFormat: "yy-mm-dd",
+	altTimeFormat: "h:m t",
+	altSeparator: " @ "
+});
+
+
+ + +
+

With inline mode using altField:

+
+ + +
+
+$('#alt_example_4').datetimepicker({
+	altField: "#alt_example_4_alt",
+	altFieldTimeOnly: false
+});
+
+
+ +

Time Restraints

+ + +
+

Set the min/max hour of every date:

+
+ +
+
+$('#rest_example_1').timepicker({
+	hourMin: 8,
+	hourMax: 16
+});
+
+
+ + +
+

Set the min/max date numerically:

+
+ +
+
+$('#rest_example_2').datetimepicker({
+	numberOfMonths: 2,
+	minDate: 0,
+	maxDate: 30
+});
+
+
+ + +
+

Set the min/max date and time with a Date object:

+
+ +
+
+$('#rest_example_3').datetimepicker({
+	minDate: new Date(2010, 11, 20, 8, 30),
+	maxDate: new Date(2010, 11, 31, 17, 30)
+});
+
+
+ + +
+

Restrict a start and end date (also shows using onSelect and onClose events):

+
+ + +
+
+var startDateTextBox = $('#rest_example_4_start');
+var endDateTextBox = $('#rest_example_4_end');
+
+startDateTextBox.datetimepicker({ 
+	onClose: function(dateText, inst) {
+		if (endDateTextBox.val() != '') {
+			var testStartDate = startDateTextBox.datetimepicker('getDate');
+			var testEndDate = endDateTextBox.datetimepicker('getDate');
+			if (testStartDate > testEndDate)
+				endDateTextBox.datetimepicker('setDate', testStartDate);
+		}
+		else {
+			endDateTextBox.val(dateText);
+		}
+	},
+	onSelect: function (selectedDateTime){
+		endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
+	}
+});
+endDateTextBox.datetimepicker({ 
+	onClose: function(dateText, inst) {
+		if (startDateTextBox.val() != '') {
+			var testStartDate = startDateTextBox.datetimepicker('getDate');
+			var testEndDate = endDateTextBox.datetimepicker('getDate');
+			if (testStartDate > testEndDate)
+				startDateTextBox.datetimepicker('setDate', testEndDate);
+		}
+		else {
+			startDateTextBox.val(dateText);
+		}
+	},
+	onSelect: function (selectedDateTime){
+		startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate') );
+	}
+});
+
+
+ + +

Utilities

+ + +
+

Get and Set Datetime:

+
+ + + +
+ +
+var ex13 = $('#utility_example_1');
+
+ex13.datetimepicker({
+	dateFormat: "D MM d, yy",
+	separator: ' @ '
+});
+
+$('#utility_example_1_setdt').click(function(){
+	ex13.datetimepicker('setDate', (new Date()) );
+});
+
+$('#utility_example_1_getdt').click(function(){
+	alert(ex13.datetimepicker('getDate'));
+});
+
+
+ + +
+

Use the utility function to format your own time. $.datepicker.formatTime(format, time, options)

+
+
format
required - string represenation of the time format to use
+
time
required - hash: { hour, minute, second, millisecond, timezone }
+
options
optional - hash of any options in regional translation (ampm, amNames, pmNames..)
+
+

Returns a time string in the specified format.

+
+
+
+ +
+$('#utility_example_2').text(
+	$.datepicker.formatTime('HH:mm z', { hour: 14, minute: 36, timezone: '+2000' }, {})
+);
+
+
+ + +
+

Use the utility function to parses a formatted time. $.datepicker.parseTime(format, timeString, options)

+
+
format
required - string represenation of the time format to use
+
time
required - time string matching the format given in parameter 1
+
options
optional - hash of any options in regional translation (ampm, amNames, pmNames..)
+
+

Returns an object with hours, minutes, seconds, milliseconds, timezone.

+
+
+
+ +
+$('#utility_example_3').text(JSON.stringify( 
+	$.datepicker.parseTime('HH:mm:ss:l z', "14:36:21:765 +2000", {}) 
+));
+
+
+ +
+
+ + +
+ + + + diff --git a/third-party/timepicker-addon-1.2/jquery-ui-sliderAccess.js b/third-party/timepicker-addon-1.2/jquery-ui-sliderAccess.js new file mode 100644 index 00000000..a54cf4ab --- /dev/null +++ b/third-party/timepicker-addon-1.2/jquery-ui-sliderAccess.js @@ -0,0 +1,89 @@ +/* + * jQuery UI Slider Access + * By: Trent Richardson [http://trentrichardson.com] + * Version 0.3 + * Last Modified: 10/20/2012 + * + * Copyright 2011 Trent Richardson + * Dual licensed under the MIT and GPL licenses. + * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt + * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt + * + */ + (function($){ + + $.fn.extend({ + sliderAccess: function(options){ + options = options || {}; + options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device + + if(options.touchonly === true && !("ontouchend" in document)) + return $(this); + + return $(this).each(function(i,obj){ + var $t = $(this), + o = $.extend({},{ + where: 'after', + step: $t.slider('option','step'), + upIcon: 'ui-icon-plus', + downIcon: 'ui-icon-minus', + text: false, + upText: '+', + downText: '-', + buttonset: true, + buttonsetTag: 'span', + isRTL: false + }, options), + $buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+ + ''+ + ''+ + ''); + + $buttons.children('button').each(function(j, jobj){ + var $jt = $(this); + $jt.button({ + text: o.text, + icons: { primary: $jt.data('icon') } + }) + .click(function(e){ + var step = $jt.data('step'), + curr = $t.slider('value'), + newval = curr += step*1, + minval = $t.slider('option','min'), + maxval = $t.slider('option','max'), + slidee = $t.slider("option", "slide") || function(){}, + stope = $t.slider("option", "stop") || function(){}; + + e.preventDefault(); + + if(newval < minval || newval > maxval) + return; + + $t.slider('value', newval); + + slidee.call($t, null, { value: newval }); + stope.call($t, null, { value: newval }); + }); + }); + + // before or after + $t[o.where]($buttons); + + if(o.buttonset){ + $buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset(); + $buttons.eq(0).addClass('ui-corner-left'); + $buttons.eq(1).addClass('ui-corner-right'); + } + + // adjust the width so we don't break the original layout + var bOuterWidth = $buttons.css({ + marginLeft: ((o.where == 'after' && !o.isRTL) || (o.where == 'before' && o.isRTL)? 10:0), + marginRight: ((o.where == 'before' && !o.isRTL) || (o.where == 'after' && o.isRTL)? 10:0) + }).outerWidth(true) + 5; + var tOuterWidth = $t.outerWidth(true); + $t.css('display','inline-block').width(tOuterWidth-bOuterWidth); + }); + } + }); + +})(jQuery); \ No newline at end of file diff --git a/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.css b/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.css new file mode 100644 index 00000000..058a608e --- /dev/null +++ b/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.css @@ -0,0 +1,11 @@ +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +.ui-timepicker-div dl { text-align: left; } +.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } +.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } +.ui-timepicker-div td { font-size: 90%; } +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } + +.ui-timepicker-rtl{ direction: rtl; } +.ui-timepicker-rtl dl { text-align: right; } +.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } + diff --git a/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.js b/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.js new file mode 100644 index 00000000..f9b5faa2 --- /dev/null +++ b/third-party/timepicker-addon-1.2/jquery-ui-timepicker-addon.js @@ -0,0 +1,1919 @@ +/* + * jQuery timepicker addon + * By: Trent Richardson [http://trentrichardson.com] + * Version 1.2 + * Last Modified: 02/02/2013 + * + * Copyright 2013 Trent Richardson + * You may use this project under MIT or GPL licenses. + * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt + * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt + */ + +/*jslint evil: true, white: false, undef: false, nomen: false */ + +(function($) { + + /* + * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" + */ + $.ui.timepicker = $.ui.timepicker || {}; + if ($.ui.timepicker.version) { + return; + } + + /* + * Extend jQueryUI, get it started with our version number + */ + $.extend($.ui, { + timepicker: { + version: "1.2" + } + }); + + /* + * Timepicker manager. + * Use the singleton instance of this class, $.timepicker, to interact with the time picker. + * Settings for (groups of) time pickers are maintained in an instance object, + * allowing multiple different settings on the same page. + */ + var Timepicker = function() { + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + currentText: 'Now', + closeText: 'Done', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + timeFormat: 'HH:mm', + timeSuffix: '', + timeOnlyTitle: 'Choose Time', + timeText: 'Time', + hourText: 'Hour', + minuteText: 'Minute', + secondText: 'Second', + millisecText: 'Millisecond', + timezoneText: 'Time Zone', + isRTL: false + }; + this._defaults = { // Global defaults for all the datetime picker instances + showButtonPanel: true, + timeOnly: false, + showHour: true, + showMinute: true, + showSecond: false, + showMillisec: false, + showTimezone: false, + showTime: true, + stepHour: 1, + stepMinute: 1, + stepSecond: 1, + stepMillisec: 1, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + timezone: null, + useLocalTimezone: false, + defaultTimezone: "+0000", + hourMin: 0, + minuteMin: 0, + secondMin: 0, + millisecMin: 0, + hourMax: 23, + minuteMax: 59, + secondMax: 59, + millisecMax: 999, + minDateTime: null, + maxDateTime: null, + onSelect: null, + hourGrid: 0, + minuteGrid: 0, + secondGrid: 0, + millisecGrid: 0, + 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, + parse: 'strict' + }; + $.extend(this._defaults, this.regional['']); + }; + + $.extend(Timepicker.prototype, { + $input: null, + $altInput: null, + $timeObj: null, + inst: null, + hour_slider: null, + minute_slider: null, + second_slider: null, + millisec_slider: null, + timezone_select: null, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + timezone: null, + defaultTimezone: "+0000", + hourMinOriginal: null, + minuteMinOriginal: null, + secondMinOriginal: null, + millisecMinOriginal: null, + hourMaxOriginal: null, + minuteMaxOriginal: null, + secondMaxOriginal: null, + millisecMaxOriginal: null, + ampm: '', + formattedDate: '', + formattedTime: '', + formattedDateTime: '', + timezoneList: null, + units: ['hour','minute','second','millisec'], + control: null, + + /* + * Override the default settings for all instances of the time picker. + * @param settings object - the new settings to use as defaults (anonymous object) + * @return the manager object + */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* + * Create a new Timepicker instance + */ + _newInst: function($input, o) { + var tp_inst = new Timepicker(), + inlineSettings = {}, + fns = {}, + overrides, i; + + for (var attrName in this._defaults) { + if(this._defaults.hasOwnProperty(attrName)){ + var attrValue = $input.attr('time:' + attrName); + if (attrValue) { + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + } + overrides = { + beforeShow: function (input, dp_inst) { + if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { + return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); + } + }, + onChangeMonthYear: function (year, month, dp_inst) { + // Update the time as well : this prevents the time from disappearing from the $input field. + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { + tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); + } + }, + onClose: function (dateText, dp_inst) { + if (tp_inst.timeDefined === true && $input.val() !== '') { + tp_inst._updateDateTime(dp_inst); + } + if ($.isFunction(tp_inst._defaults.evnts.onClose)) { + tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); + } + } + }; + for (i in overrides) { + if (overrides.hasOwnProperty(i)) { + fns[i] = o[i] || null; + } + } + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, overrides, { + evnts:fns, + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); + }); + tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { + return val.toUpperCase(); + }); + tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { + return val.toUpperCase(); + }); + + // controlType is string - key to our this._controls + if(typeof(tp_inst._defaults.controlType) === 'string'){ + if($.fn[tp_inst._defaults.controlType] === undefined){ + tp_inst._defaults.controlType = 'select'; + } + tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; + } + // controlType is an object and must implement create, options, value methods + else{ + tp_inst.control = tp_inst._defaults.controlType; + } + + if (tp_inst._defaults.timezoneList === null) { + var timezoneList = ['-1200', '-1100', '-1000', '-0930', '-0900', '-0800', '-0700', '-0600', '-0500', '-0430', '-0400', '-0330', '-0300', '-0200', '-0100', '+0000', + '+0100', '+0200', '+0300', '+0330', '+0400', '+0430', '+0500', '+0530', '+0545', '+0600', '+0630', '+0700', '+0800', '+0845', '+0900', '+0930', + '+1000', '+1030', '+1100', '+1130', '+1200', '+1245', '+1300', '+1400']; + + if (tp_inst._defaults.timezoneIso8601) { + timezoneList = $.map(timezoneList, function(val) { + return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3)); + }); + } + tp_inst._defaults.timezoneList = timezoneList; + } + + tp_inst.timezone = tp_inst._defaults.timezone; + tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin? tp_inst._defaults.hourMin : + tp_inst._defaults.hour > tp_inst._defaults.hourMax? tp_inst._defaults.hourMax : tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin? tp_inst._defaults.minuteMin : + tp_inst._defaults.minute > tp_inst._defaults.minuteMax? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin? tp_inst._defaults.secondMin : + tp_inst._defaults.second > tp_inst._defaults.secondMax? tp_inst._defaults.secondMax : tp_inst._defaults.second; + tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin? tp_inst._defaults.millisecMin : + tp_inst._defaults.millisec > tp_inst._defaults.millisecMax? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; + tp_inst.ampm = ''; + tp_inst.$input = $input; + + if (o.altField) { + tp_inst.$altInput = $(o.altField).css({ + cursor: 'pointer' + }).focus(function() { + $input.trigger("focus"); + }); + } + + if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { + tp_inst._defaults.minDate = new Date(); + } + if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { + tp_inst._defaults.maxDate = new Date(); + } + + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. + if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); + } + if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); + } + if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); + } + if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); + } + tp_inst.$input.bind('focus', function() { + tp_inst._onFocus(); + }); + + return tp_inst; + }, + + /* + * add our sliders to the calendar + */ + _addTimePicker: function(dp_inst) { + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val(); + + this.timeDefined = this._parseTime(currDT); + this._limitMinMaxDateTime(dp_inst, false); + this._injectTimePicker(); + }, + + /* + * parse the time string from input value or _setTime + */ + _parseTime: function(timeString, withDate) { + if (!this.inst) { + this.inst = $.datepicker._getInst(this.$input[0]); + } + + if (withDate || !this._defaults.timeOnly) { + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); + try { + var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); + if (!parseRes.timeObj) { + return false; + } + $.extend(this, parseRes.timeObj); + } catch (err) { + $.timepicker.log("Error parsing the date/time string: " + err + + "\ndate/time string = " + timeString + + "\ntimeFormat = " + this._defaults.timeFormat + + "\ndateFormat = " + dp_dateFormat); + return false; + } + return true; + } else { + var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); + if (!timeObj) { + return false; + } + $.extend(this, timeObj); + return true; + } + }, + + /* + * generate and inject html for timepicker into ui datepicker + */ + _injectTimePicker: function() { + var $dp = this.inst.dpDiv, + o = this.inst.settings, + tp_inst = this, + litem = '', + uitem = '', + max = {}, + gridSize = {}, + size = null; + + // Prevent displaying twice + if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { + var noDisplay = ' style="display:none;"', + html = '
' + '
' + o.timeText + '
' + + '
'; + + // Create the markup + for(var i=0,l=this.units.length; i' + o[litem +'Text'] + '' + + '
'; + + if (o['show'+uitem] && o[litem+'Grid'] > 0) { + html += '
'; + + if(litem == 'hour'){ + for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) { + gridSize[litem]++; + var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat)? 'hht':'HH', {hour:h}, o); + html += ''; + } + } + else{ + for (var m = o[litem+'Min']; m <= max[litem]; m += parseInt(o[litem+'Grid'], 10)) { + gridSize[litem]++; + html += ''; + } + } + + html += '
' + tmph + '' + ((m < 10) ? '0' : '') + m + '
'; + } + html += '
'; + } + + // Timezone + html += '
' + o.timezoneText + '
'; + html += '
'; + + // Create the elements from string + html += '
'; + var $tp = $(html); + + // if we only want time picker... + if (o.timeOnly === true) { + $tp.prepend('
' + '
' + o.timeOnlyTitle + '
' + '
'); + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); + } + + // add sliders, adjust grids, add events + for(var i=0,l=tp_inst.units.length; i 0) { + size = 100 * gridSize[litem] * o[litem+'Grid'] / (max[litem] - o[litem+'Min']); + $tp.find('.ui_tpicker_'+litem+' table').css({ + width: size + "%", + marginLeft: o.isRTL? '0' : ((size / (-2 * gridSize[litem])) + "%"), + marginRight: o.isRTL? ((size / (-2 * gridSize[litem])) + "%") : '0', + borderCollapse: 'collapse' + }).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'){ + if(ap.indexOf('p') !== -1 && n < 12){ + n += 12; + } + else{ + if(ap.indexOf('a') !== -1 && n === 12){ + n = 0; + } + } + } + + tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, n); + + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + }) + .css({ + cursor: 'pointer', + width: (100 / gridSize[litem]) + '%', + textAlign: 'center', + overflow: 'hidden' + }); + } // end if grid > 0 + } // end for loop + + // Add timezone options + this.timezone_select = $tp.find('.ui_tpicker_timezone').append('').find("select"); + $.fn.append.apply(this.timezone_select, + $.map(o.timezoneList, function(val, idx) { + return $("