Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../js
File: jquery-ui-timepicker-addon.1722265817.js
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
[0] Fix | Delete
* http://trentrichardson.com/examples/timepicker
[1] Fix | Delete
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
[2] Fix | Delete
(function (factory) {
[3] Fix | Delete
if (typeof define === 'function' && define.amd) {
[4] Fix | Delete
define(['jquery', 'jquery-ui'], factory);
[5] Fix | Delete
} else {
[6] Fix | Delete
factory(jQuery);
[7] Fix | Delete
}
[8] Fix | Delete
}(function ($) {
[9] Fix | Delete
[10] Fix | Delete
/*
[11] Fix | Delete
* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
[12] Fix | Delete
*/
[13] Fix | Delete
$.ui.timepicker = $.ui.timepicker || {};
[14] Fix | Delete
if ($.ui.timepicker.version) {
[15] Fix | Delete
return;
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
/*
[19] Fix | Delete
* Extend jQueryUI, get it started with our version number
[20] Fix | Delete
*/
[21] Fix | Delete
$.extend($.ui, {
[22] Fix | Delete
timepicker: {
[23] Fix | Delete
version: "1.6.3"
[24] Fix | Delete
}
[25] Fix | Delete
});
[26] Fix | Delete
[27] Fix | Delete
/*
[28] Fix | Delete
* Timepicker manager.
[29] Fix | Delete
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
[30] Fix | Delete
* Settings for (groups of) time pickers are maintained in an instance object,
[31] Fix | Delete
* allowing multiple different settings on the same page.
[32] Fix | Delete
*/
[33] Fix | Delete
var Timepicker = function () {
[34] Fix | Delete
this.regional = []; // Available regional settings, indexed by language code
[35] Fix | Delete
this.regional[''] = { // Default regional settings
[36] Fix | Delete
currentText: 'Now',
[37] Fix | Delete
closeText: 'Done',
[38] Fix | Delete
amNames: ['AM', 'A'],
[39] Fix | Delete
pmNames: ['PM', 'P'],
[40] Fix | Delete
timeFormat: 'HH:mm',
[41] Fix | Delete
timeSuffix: '',
[42] Fix | Delete
timeOnlyTitle: 'Choose Time',
[43] Fix | Delete
timeText: 'Time',
[44] Fix | Delete
hourText: 'Hour',
[45] Fix | Delete
minuteText: 'Minute',
[46] Fix | Delete
secondText: 'Second',
[47] Fix | Delete
millisecText: 'Millisecond',
[48] Fix | Delete
microsecText: 'Microsecond',
[49] Fix | Delete
timezoneText: 'Time Zone',
[50] Fix | Delete
isRTL: false
[51] Fix | Delete
};
[52] Fix | Delete
this._defaults = { // Global defaults for all the datetime picker instances
[53] Fix | Delete
showButtonPanel: true,
[54] Fix | Delete
timeOnly: false,
[55] Fix | Delete
timeOnlyShowDate: false,
[56] Fix | Delete
showHour: null,
[57] Fix | Delete
showMinute: null,
[58] Fix | Delete
showSecond: null,
[59] Fix | Delete
showMillisec: null,
[60] Fix | Delete
showMicrosec: null,
[61] Fix | Delete
showTimezone: null,
[62] Fix | Delete
showTime: true,
[63] Fix | Delete
stepHour: 1,
[64] Fix | Delete
stepMinute: 1,
[65] Fix | Delete
stepSecond: 1,
[66] Fix | Delete
stepMillisec: 1,
[67] Fix | Delete
stepMicrosec: 1,
[68] Fix | Delete
hour: 0,
[69] Fix | Delete
minute: 0,
[70] Fix | Delete
second: 0,
[71] Fix | Delete
millisec: 0,
[72] Fix | Delete
microsec: 0,
[73] Fix | Delete
timezone: null,
[74] Fix | Delete
hourMin: 0,
[75] Fix | Delete
minuteMin: 0,
[76] Fix | Delete
secondMin: 0,
[77] Fix | Delete
millisecMin: 0,
[78] Fix | Delete
microsecMin: 0,
[79] Fix | Delete
hourMax: 23,
[80] Fix | Delete
minuteMax: 59,
[81] Fix | Delete
secondMax: 59,
[82] Fix | Delete
millisecMax: 999,
[83] Fix | Delete
microsecMax: 999,
[84] Fix | Delete
minDateTime: null,
[85] Fix | Delete
maxDateTime: null,
[86] Fix | Delete
maxTime: null,
[87] Fix | Delete
minTime: null,
[88] Fix | Delete
onSelect: null,
[89] Fix | Delete
hourGrid: 0,
[90] Fix | Delete
minuteGrid: 0,
[91] Fix | Delete
secondGrid: 0,
[92] Fix | Delete
millisecGrid: 0,
[93] Fix | Delete
microsecGrid: 0,
[94] Fix | Delete
alwaysSetTime: true,
[95] Fix | Delete
separator: ' ',
[96] Fix | Delete
altFieldTimeOnly: true,
[97] Fix | Delete
altTimeFormat: null,
[98] Fix | Delete
altSeparator: null,
[99] Fix | Delete
altTimeSuffix: null,
[100] Fix | Delete
altRedirectFocus: true,
[101] Fix | Delete
pickerTimeFormat: null,
[102] Fix | Delete
pickerTimeSuffix: null,
[103] Fix | Delete
showTimepicker: true,
[104] Fix | Delete
timezoneList: null,
[105] Fix | Delete
addSliderAccess: false,
[106] Fix | Delete
sliderAccessArgs: null,
[107] Fix | Delete
controlType: 'slider',
[108] Fix | Delete
oneLine: false,
[109] Fix | Delete
defaultValue: null,
[110] Fix | Delete
parse: 'strict',
[111] Fix | Delete
afterInject: null
[112] Fix | Delete
};
[113] Fix | Delete
$.extend(this._defaults, this.regional['']);
[114] Fix | Delete
};
[115] Fix | Delete
[116] Fix | Delete
$.extend(Timepicker.prototype, {
[117] Fix | Delete
$input: null,
[118] Fix | Delete
$altInput: null,
[119] Fix | Delete
$timeObj: null,
[120] Fix | Delete
inst: null,
[121] Fix | Delete
hour_slider: null,
[122] Fix | Delete
minute_slider: null,
[123] Fix | Delete
second_slider: null,
[124] Fix | Delete
millisec_slider: null,
[125] Fix | Delete
microsec_slider: null,
[126] Fix | Delete
timezone_select: null,
[127] Fix | Delete
maxTime: null,
[128] Fix | Delete
minTime: null,
[129] Fix | Delete
hour: 0,
[130] Fix | Delete
minute: 0,
[131] Fix | Delete
second: 0,
[132] Fix | Delete
millisec: 0,
[133] Fix | Delete
microsec: 0,
[134] Fix | Delete
timezone: null,
[135] Fix | Delete
hourMinOriginal: null,
[136] Fix | Delete
minuteMinOriginal: null,
[137] Fix | Delete
secondMinOriginal: null,
[138] Fix | Delete
millisecMinOriginal: null,
[139] Fix | Delete
microsecMinOriginal: null,
[140] Fix | Delete
hourMaxOriginal: null,
[141] Fix | Delete
minuteMaxOriginal: null,
[142] Fix | Delete
secondMaxOriginal: null,
[143] Fix | Delete
millisecMaxOriginal: null,
[144] Fix | Delete
microsecMaxOriginal: null,
[145] Fix | Delete
ampm: '',
[146] Fix | Delete
formattedDate: '',
[147] Fix | Delete
formattedTime: '',
[148] Fix | Delete
formattedDateTime: '',
[149] Fix | Delete
timezoneList: null,
[150] Fix | Delete
units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
[151] Fix | Delete
support: {},
[152] Fix | Delete
control: null,
[153] Fix | Delete
[154] Fix | Delete
/*
[155] Fix | Delete
* Override the default settings for all instances of the time picker.
[156] Fix | Delete
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
[157] Fix | Delete
* @return {Object} the manager object
[158] Fix | Delete
*/
[159] Fix | Delete
setDefaults: function (settings) {
[160] Fix | Delete
extendRemove(this._defaults, settings || {});
[161] Fix | Delete
return this;
[162] Fix | Delete
},
[163] Fix | Delete
[164] Fix | Delete
/*
[165] Fix | Delete
* Create a new Timepicker instance
[166] Fix | Delete
*/
[167] Fix | Delete
_newInst: function ($input, opts) {
[168] Fix | Delete
var tp_inst = new Timepicker(),
[169] Fix | Delete
inlineSettings = {},
[170] Fix | Delete
fns = {},
[171] Fix | Delete
overrides, i;
[172] Fix | Delete
[173] Fix | Delete
for (var attrName in this._defaults) {
[174] Fix | Delete
if (this._defaults.hasOwnProperty(attrName)) {
[175] Fix | Delete
var attrValue = $input.attr('time:' + attrName);
[176] Fix | Delete
if (attrValue) {
[177] Fix | Delete
try {
[178] Fix | Delete
inlineSettings[attrName] = eval(attrValue);
[179] Fix | Delete
} catch (err) {
[180] Fix | Delete
inlineSettings[attrName] = attrValue;
[181] Fix | Delete
}
[182] Fix | Delete
}
[183] Fix | Delete
}
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
overrides = {
[187] Fix | Delete
beforeShow: function (input, dp_inst) {
[188] Fix | Delete
if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
[189] Fix | Delete
return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
[190] Fix | Delete
}
[191] Fix | Delete
},
[192] Fix | Delete
onChangeMonthYear: function (year, month, dp_inst) {
[193] Fix | Delete
// Update the time as well : this prevents the time from disappearing from the $input field.
[194] Fix | Delete
// tp_inst._updateDateTime(dp_inst);
[195] Fix | Delete
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
[196] Fix | Delete
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
[197] Fix | Delete
}
[198] Fix | Delete
},
[199] Fix | Delete
onClose: function (dateText, dp_inst) {
[200] Fix | Delete
if (tp_inst.timeDefined === true && $input.val() !== '') {
[201] Fix | Delete
tp_inst._updateDateTime(dp_inst);
[202] Fix | Delete
}
[203] Fix | Delete
if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
[204] Fix | Delete
tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
[205] Fix | Delete
}
[206] Fix | Delete
}
[207] Fix | Delete
};
[208] Fix | Delete
for (i in overrides) {
[209] Fix | Delete
if (overrides.hasOwnProperty(i)) {
[210] Fix | Delete
fns[i] = opts[i] || this._defaults[i] || null;
[211] Fix | Delete
}
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
[215] Fix | Delete
evnts: fns,
[216] Fix | Delete
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
[217] Fix | Delete
});
[218] Fix | Delete
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
[219] Fix | Delete
return val.toUpperCase();
[220] Fix | Delete
});
[221] Fix | Delete
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
[222] Fix | Delete
return val.toUpperCase();
[223] Fix | Delete
});
[224] Fix | Delete
[225] Fix | Delete
// detect which units are supported
[226] Fix | Delete
tp_inst.support = detectSupport(
[227] Fix | Delete
tp_inst._defaults.timeFormat +
[228] Fix | Delete
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
[229] Fix | Delete
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
[230] Fix | Delete
[231] Fix | Delete
// controlType is string - key to our this._controls
[232] Fix | Delete
if (typeof(tp_inst._defaults.controlType) === 'string') {
[233] Fix | Delete
if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {
[234] Fix | Delete
tp_inst._defaults.controlType = 'select';
[235] Fix | Delete
}
[236] Fix | Delete
tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
[237] Fix | Delete
}
[238] Fix | Delete
// controlType is an object and must implement create, options, value methods
[239] Fix | Delete
else {
[240] Fix | Delete
tp_inst.control = tp_inst._defaults.controlType;
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
// prep the timezone options
[244] Fix | Delete
var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
[245] Fix | Delete
0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
[246] Fix | Delete
if (tp_inst._defaults.timezoneList !== null) {
[247] Fix | Delete
timezoneList = tp_inst._defaults.timezoneList;
[248] Fix | Delete
}
[249] Fix | Delete
var tzl = timezoneList.length, tzi = 0, tzv = null;
[250] Fix | Delete
if (tzl > 0 && typeof timezoneList[0] !== 'object') {
[251] Fix | Delete
for (; tzi < tzl; tzi++) {
[252] Fix | Delete
tzv = timezoneList[tzi];
[253] Fix | Delete
timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
[254] Fix | Delete
}
[255] Fix | Delete
}
[256] Fix | Delete
tp_inst._defaults.timezoneList = timezoneList;
[257] Fix | Delete
[258] Fix | Delete
// set the default units
[259] Fix | Delete
tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
[260] Fix | Delete
((new Date()).getTimezoneOffset() * -1);
[261] Fix | Delete
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
[262] Fix | Delete
tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
[263] Fix | Delete
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
[264] Fix | Delete
tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
[265] Fix | Delete
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
[266] Fix | Delete
tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
[267] Fix | Delete
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
[268] Fix | Delete
tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
[269] Fix | Delete
tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
[270] Fix | Delete
tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
[271] Fix | Delete
tp_inst.ampm = '';
[272] Fix | Delete
tp_inst.$input = $input;
[273] Fix | Delete
[274] Fix | Delete
if (tp_inst._defaults.altField) {
[275] Fix | Delete
tp_inst.$altInput = $(tp_inst._defaults.altField);
[276] Fix | Delete
if (tp_inst._defaults.altRedirectFocus === true) {
[277] Fix | Delete
tp_inst.$altInput.css({
[278] Fix | Delete
cursor: 'pointer'
[279] Fix | Delete
}).focus(function () {
[280] Fix | Delete
$input.trigger("focus");
[281] Fix | Delete
});
[282] Fix | Delete
}
[283] Fix | Delete
}
[284] Fix | Delete
[285] Fix | Delete
if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
[286] Fix | Delete
tp_inst._defaults.minDate = new Date();
[287] Fix | Delete
}
[288] Fix | Delete
if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
[289] Fix | Delete
tp_inst._defaults.maxDate = new Date();
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
[293] Fix | Delete
if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
[294] Fix | Delete
tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
[295] Fix | Delete
}
[296] Fix | Delete
if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
[297] Fix | Delete
tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
[298] Fix | Delete
}
[299] Fix | Delete
if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
[300] Fix | Delete
tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
[301] Fix | Delete
}
[302] Fix | Delete
if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
[303] Fix | Delete
tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
[304] Fix | Delete
}
[305] Fix | Delete
tp_inst.$input.bind('focus', function () {
[306] Fix | Delete
tp_inst._onFocus();
[307] Fix | Delete
});
[308] Fix | Delete
[309] Fix | Delete
return tp_inst;
[310] Fix | Delete
},
[311] Fix | Delete
[312] Fix | Delete
/*
[313] Fix | Delete
* add our sliders to the calendar
[314] Fix | Delete
*/
[315] Fix | Delete
_addTimePicker: function (dp_inst) {
[316] Fix | Delete
var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());
[317] Fix | Delete
[318] Fix | Delete
this.timeDefined = this._parseTime(currDT);
[319] Fix | Delete
this._limitMinMaxDateTime(dp_inst, false);
[320] Fix | Delete
this._injectTimePicker();
[321] Fix | Delete
this._afterInject();
[322] Fix | Delete
},
[323] Fix | Delete
[324] Fix | Delete
/*
[325] Fix | Delete
* parse the time string from input value or _setTime
[326] Fix | Delete
*/
[327] Fix | Delete
_parseTime: function (timeString, withDate) {
[328] Fix | Delete
if (!this.inst) {
[329] Fix | Delete
this.inst = $.datepicker._getInst(this.$input[0]);
[330] Fix | Delete
}
[331] Fix | Delete
[332] Fix | Delete
if (withDate || !this._defaults.timeOnly) {
[333] Fix | Delete
var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
[334] Fix | Delete
try {
[335] Fix | Delete
var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
[336] Fix | Delete
if (!parseRes.timeObj) {
[337] Fix | Delete
return false;
[338] Fix | Delete
}
[339] Fix | Delete
$.extend(this, parseRes.timeObj);
[340] Fix | Delete
} catch (err) {
[341] Fix | Delete
$.timepicker.log("Error parsing the date/time string: " + err +
[342] Fix | Delete
"\ndate/time string = " + timeString +
[343] Fix | Delete
"\ntimeFormat = " + this._defaults.timeFormat +
[344] Fix | Delete
"\ndateFormat = " + dp_dateFormat);
[345] Fix | Delete
return false;
[346] Fix | Delete
}
[347] Fix | Delete
return true;
[348] Fix | Delete
} else {
[349] Fix | Delete
var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
[350] Fix | Delete
if (!timeObj) {
[351] Fix | Delete
return false;
[352] Fix | Delete
}
[353] Fix | Delete
$.extend(this, timeObj);
[354] Fix | Delete
return true;
[355] Fix | Delete
}
[356] Fix | Delete
},
[357] Fix | Delete
[358] Fix | Delete
/*
[359] Fix | Delete
* Handle callback option after injecting timepicker
[360] Fix | Delete
*/
[361] Fix | Delete
_afterInject: function() {
[362] Fix | Delete
var o = this.inst.settings;
[363] Fix | Delete
if ($.isFunction(o.afterInject)) {
[364] Fix | Delete
o.afterInject.call(this);
[365] Fix | Delete
}
[366] Fix | Delete
},
[367] Fix | Delete
[368] Fix | Delete
/*
[369] Fix | Delete
* generate and inject html for timepicker into ui datepicker
[370] Fix | Delete
*/
[371] Fix | Delete
_injectTimePicker: function () {
[372] Fix | Delete
var $dp = this.inst.dpDiv,
[373] Fix | Delete
o = this.inst.settings,
[374] Fix | Delete
tp_inst = this,
[375] Fix | Delete
litem = '',
[376] Fix | Delete
uitem = '',
[377] Fix | Delete
show = null,
[378] Fix | Delete
max = {},
[379] Fix | Delete
gridSize = {},
[380] Fix | Delete
size = null,
[381] Fix | Delete
i = 0,
[382] Fix | Delete
l = 0;
[383] Fix | Delete
[384] Fix | Delete
// Prevent displaying twice
[385] Fix | Delete
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
[386] Fix | Delete
var noDisplay = ' ui_tpicker_unit_hide',
[387] Fix | Delete
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' +
[388] Fix | Delete
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';
[389] Fix | Delete
[390] Fix | Delete
// Create the markup
[391] Fix | Delete
for (i = 0, l = this.units.length; i < l; i++) {
[392] Fix | Delete
litem = this.units[i];
[393] Fix | Delete
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
[394] Fix | Delete
show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
[395] Fix | Delete
[396] Fix | Delete
// Added by Peter Medeiros:
[397] Fix | Delete
// - Figure out what the hour/minute/second max should be based on the step values.
[398] Fix | Delete
// - Example: if stepMinute is 15, then minMax is 45.
[399] Fix | Delete
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
[400] Fix | Delete
gridSize[litem] = 0;
[401] Fix | Delete
[402] Fix | Delete
html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
[403] Fix | Delete
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';
[404] Fix | Delete
[405] Fix | Delete
if (show && o[litem + 'Grid'] > 0) {
[406] Fix | Delete
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
[407] Fix | Delete
[408] Fix | Delete
if (litem === 'hour') {
[409] Fix | Delete
for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
[410] Fix | Delete
gridSize[litem]++;
[411] Fix | Delete
var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
[412] Fix | Delete
html += '<td data-for="' + litem + '">' + tmph + '</td>';
[413] Fix | Delete
}
[414] Fix | Delete
}
[415] Fix | Delete
else {
[416] Fix | Delete
for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
[417] Fix | Delete
gridSize[litem]++;
[418] Fix | Delete
html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
[419] Fix | Delete
}
[420] Fix | Delete
}
[421] Fix | Delete
[422] Fix | Delete
html += '</tr></table></div>';
[423] Fix | Delete
}
[424] Fix | Delete
html += '</dd>';
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
// Timezone
[428] Fix | Delete
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
[429] Fix | Delete
html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
[430] Fix | Delete
html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>';
[431] Fix | Delete
[432] Fix | Delete
// Create the elements from string
[433] Fix | Delete
html += '</dl></div>';
[434] Fix | Delete
var $tp = $(html);
[435] Fix | Delete
[436] Fix | Delete
// if we only want time picker...
[437] Fix | Delete
if (o.timeOnly === true) {
[438] Fix | Delete
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
[439] Fix | Delete
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
[440] Fix | Delete
}
[441] Fix | Delete
[442] Fix | Delete
// add sliders, adjust grids, add events
[443] Fix | Delete
for (i = 0, l = tp_inst.units.length; i < l; i++) {
[444] Fix | Delete
litem = tp_inst.units[i];
[445] Fix | Delete
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
[446] Fix | Delete
show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
[447] Fix | Delete
[448] Fix | Delete
// add the slider
[449] Fix | Delete
tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);
[450] Fix | Delete
[451] Fix | Delete
// adjust the grid and add click event
[452] Fix | Delete
if (show && o[litem + 'Grid'] > 0) {
[453] Fix | Delete
size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
[454] Fix | Delete
$tp.find('.ui_tpicker_' + litem + ' table').css({
[455] Fix | Delete
width: size + "%",
[456] Fix | Delete
marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
[457] Fix | Delete
marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
[458] Fix | Delete
borderCollapse: 'collapse'
[459] Fix | Delete
}).find("td").click(function (e) {
[460] Fix | Delete
var $t = $(this),
[461] Fix | Delete
h = $t.html(),
[462] Fix | Delete
n = parseInt(h.replace(/[^0-9]/g), 10),
[463] Fix | Delete
ap = h.replace(/[^apm]/ig),
[464] Fix | Delete
f = $t.data('for'); // loses scope, so we use data-for
[465] Fix | Delete
[466] Fix | Delete
if (f === 'hour') {
[467] Fix | Delete
if (ap.indexOf('p') !== -1 && n < 12) {
[468] Fix | Delete
n += 12;
[469] Fix | Delete
}
[470] Fix | Delete
else {
[471] Fix | Delete
if (ap.indexOf('a') !== -1 && n === 12) {
[472] Fix | Delete
n = 0;
[473] Fix | Delete
}
[474] Fix | Delete
}
[475] Fix | Delete
}
[476] Fix | Delete
[477] Fix | Delete
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
[478] Fix | Delete
[479] Fix | Delete
tp_inst._onTimeChange();
[480] Fix | Delete
tp_inst._onSelectHandler();
[481] Fix | Delete
}).css({
[482] Fix | Delete
cursor: 'pointer',
[483] Fix | Delete
width: (100 / gridSize[litem]) + '%',
[484] Fix | Delete
textAlign: 'center',
[485] Fix | Delete
overflow: 'hidden'
[486] Fix | Delete
});
[487] Fix | Delete
} // end if grid > 0
[488] Fix | Delete
} // end for loop
[489] Fix | Delete
[490] Fix | Delete
// Add timezone options
[491] Fix | Delete
this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
[492] Fix | Delete
$.fn.append.apply(this.timezone_select,
[493] Fix | Delete
$.map(o.timezoneList, function (val, idx) {
[494] Fix | Delete
return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
[495] Fix | Delete
}));
[496] Fix | Delete
if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
[497] Fix | Delete
var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
[498] Fix | Delete
if (local_timezone === this.timezone) {
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function