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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/scripts/ext
File: jquery-ui-timepicker-addon.js
var timeDefined = this.timeDefined;
[500] Fix | Delete
this._onTimeChange();
[501] Fix | Delete
this.timeDefined = timeDefined;
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
[505] Fix | Delete
if (this._defaults.addSliderAccess) {
[506] Fix | Delete
var sliderAccessArgs = this._defaults.sliderAccessArgs,
[507] Fix | Delete
rtl = this._defaults.isRTL;
[508] Fix | Delete
sliderAccessArgs.isRTL = rtl;
[509] Fix | Delete
[510] Fix | Delete
setTimeout(function () { // fix for inline mode
[511] Fix | Delete
if ($tp.find('.ui-slider-access').length === 0) {
[512] Fix | Delete
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
[513] Fix | Delete
[514] Fix | Delete
// fix any grids since sliders are shorter
[515] Fix | Delete
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
[516] Fix | Delete
if (sliderAccessWidth) {
[517] Fix | Delete
$tp.find('table:visible').each(function () {
[518] Fix | Delete
var $g = $(this),
[519] Fix | Delete
oldWidth = $g.outerWidth(),
[520] Fix | Delete
oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
[521] Fix | Delete
newWidth = oldWidth - sliderAccessWidth,
[522] Fix | Delete
newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
[523] Fix | Delete
css = { width: newWidth, marginRight: 0, marginLeft: 0 };
[524] Fix | Delete
css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
[525] Fix | Delete
$g.css(css);
[526] Fix | Delete
});
[527] Fix | Delete
}
[528] Fix | Delete
}
[529] Fix | Delete
}, 10);
[530] Fix | Delete
}
[531] Fix | Delete
// end slideAccess integration
[532] Fix | Delete
[533] Fix | Delete
tp_inst._limitMinMaxDateTime(this.inst, true);
[534] Fix | Delete
}
[535] Fix | Delete
},
[536] Fix | Delete
[537] Fix | Delete
/*
[538] Fix | Delete
* This function tries to limit the ability to go outside the
[539] Fix | Delete
* min/max date range
[540] Fix | Delete
*/
[541] Fix | Delete
_limitMinMaxDateTime: function (dp_inst, adjustSliders) {
[542] Fix | Delete
var o = this._defaults,
[543] Fix | Delete
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
[544] Fix | Delete
[545] Fix | Delete
if (!this._defaults.showTimepicker) {
[546] Fix | Delete
return;
[547] Fix | Delete
} // No time so nothing to check here
[548] Fix | Delete
[549] Fix | Delete
if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
[550] Fix | Delete
var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
[551] Fix | Delete
minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
[552] Fix | Delete
[553] Fix | Delete
if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
[554] Fix | Delete
this.hourMinOriginal = o.hourMin;
[555] Fix | Delete
this.minuteMinOriginal = o.minuteMin;
[556] Fix | Delete
this.secondMinOriginal = o.secondMin;
[557] Fix | Delete
this.millisecMinOriginal = o.millisecMin;
[558] Fix | Delete
this.microsecMinOriginal = o.microsecMin;
[559] Fix | Delete
}
[560] Fix | Delete
[561] Fix | Delete
if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
[562] Fix | Delete
this._defaults.hourMin = minDateTime.getHours();
[563] Fix | Delete
if (this.hour <= this._defaults.hourMin) {
[564] Fix | Delete
this.hour = this._defaults.hourMin;
[565] Fix | Delete
this._defaults.minuteMin = minDateTime.getMinutes();
[566] Fix | Delete
if (this.minute <= this._defaults.minuteMin) {
[567] Fix | Delete
this.minute = this._defaults.minuteMin;
[568] Fix | Delete
this._defaults.secondMin = minDateTime.getSeconds();
[569] Fix | Delete
if (this.second <= this._defaults.secondMin) {
[570] Fix | Delete
this.second = this._defaults.secondMin;
[571] Fix | Delete
this._defaults.millisecMin = minDateTime.getMilliseconds();
[572] Fix | Delete
if (this.millisec <= this._defaults.millisecMin) {
[573] Fix | Delete
this.millisec = this._defaults.millisecMin;
[574] Fix | Delete
this._defaults.microsecMin = minDateTime.getMicroseconds();
[575] Fix | Delete
} else {
[576] Fix | Delete
if (this.microsec < this._defaults.microsecMin) {
[577] Fix | Delete
this.microsec = this._defaults.microsecMin;
[578] Fix | Delete
}
[579] Fix | Delete
this._defaults.microsecMin = this.microsecMinOriginal;
[580] Fix | Delete
}
[581] Fix | Delete
} else {
[582] Fix | Delete
this._defaults.millisecMin = this.millisecMinOriginal;
[583] Fix | Delete
this._defaults.microsecMin = this.microsecMinOriginal;
[584] Fix | Delete
}
[585] Fix | Delete
} else {
[586] Fix | Delete
this._defaults.secondMin = this.secondMinOriginal;
[587] Fix | Delete
this._defaults.millisecMin = this.millisecMinOriginal;
[588] Fix | Delete
this._defaults.microsecMin = this.microsecMinOriginal;
[589] Fix | Delete
}
[590] Fix | Delete
} else {
[591] Fix | Delete
this._defaults.minuteMin = this.minuteMinOriginal;
[592] Fix | Delete
this._defaults.secondMin = this.secondMinOriginal;
[593] Fix | Delete
this._defaults.millisecMin = this.millisecMinOriginal;
[594] Fix | Delete
this._defaults.microsecMin = this.microsecMinOriginal;
[595] Fix | Delete
}
[596] Fix | Delete
} else {
[597] Fix | Delete
this._defaults.hourMin = this.hourMinOriginal;
[598] Fix | Delete
this._defaults.minuteMin = this.minuteMinOriginal;
[599] Fix | Delete
this._defaults.secondMin = this.secondMinOriginal;
[600] Fix | Delete
this._defaults.millisecMin = this.millisecMinOriginal;
[601] Fix | Delete
this._defaults.microsecMin = this.microsecMinOriginal;
[602] Fix | Delete
}
[603] Fix | Delete
}
[604] Fix | Delete
[605] Fix | Delete
if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
[606] Fix | Delete
var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
[607] Fix | Delete
maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
[608] Fix | Delete
[609] Fix | Delete
if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
[610] Fix | Delete
this.hourMaxOriginal = o.hourMax;
[611] Fix | Delete
this.minuteMaxOriginal = o.minuteMax;
[612] Fix | Delete
this.secondMaxOriginal = o.secondMax;
[613] Fix | Delete
this.millisecMaxOriginal = o.millisecMax;
[614] Fix | Delete
this.microsecMaxOriginal = o.microsecMax;
[615] Fix | Delete
}
[616] Fix | Delete
[617] Fix | Delete
if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
[618] Fix | Delete
this._defaults.hourMax = maxDateTime.getHours();
[619] Fix | Delete
if (this.hour >= this._defaults.hourMax) {
[620] Fix | Delete
this.hour = this._defaults.hourMax;
[621] Fix | Delete
this._defaults.minuteMax = maxDateTime.getMinutes();
[622] Fix | Delete
if (this.minute >= this._defaults.minuteMax) {
[623] Fix | Delete
this.minute = this._defaults.minuteMax;
[624] Fix | Delete
this._defaults.secondMax = maxDateTime.getSeconds();
[625] Fix | Delete
if (this.second >= this._defaults.secondMax) {
[626] Fix | Delete
this.second = this._defaults.secondMax;
[627] Fix | Delete
this._defaults.millisecMax = maxDateTime.getMilliseconds();
[628] Fix | Delete
if (this.millisec >= this._defaults.millisecMax) {
[629] Fix | Delete
this.millisec = this._defaults.millisecMax;
[630] Fix | Delete
this._defaults.microsecMax = maxDateTime.getMicroseconds();
[631] Fix | Delete
} else {
[632] Fix | Delete
if (this.microsec > this._defaults.microsecMax) {
[633] Fix | Delete
this.microsec = this._defaults.microsecMax;
[634] Fix | Delete
}
[635] Fix | Delete
this._defaults.microsecMax = this.microsecMaxOriginal;
[636] Fix | Delete
}
[637] Fix | Delete
} else {
[638] Fix | Delete
this._defaults.millisecMax = this.millisecMaxOriginal;
[639] Fix | Delete
this._defaults.microsecMax = this.microsecMaxOriginal;
[640] Fix | Delete
}
[641] Fix | Delete
} else {
[642] Fix | Delete
this._defaults.secondMax = this.secondMaxOriginal;
[643] Fix | Delete
this._defaults.millisecMax = this.millisecMaxOriginal;
[644] Fix | Delete
this._defaults.microsecMax = this.microsecMaxOriginal;
[645] Fix | Delete
}
[646] Fix | Delete
} else {
[647] Fix | Delete
this._defaults.minuteMax = this.minuteMaxOriginal;
[648] Fix | Delete
this._defaults.secondMax = this.secondMaxOriginal;
[649] Fix | Delete
this._defaults.millisecMax = this.millisecMaxOriginal;
[650] Fix | Delete
this._defaults.microsecMax = this.microsecMaxOriginal;
[651] Fix | Delete
}
[652] Fix | Delete
} else {
[653] Fix | Delete
this._defaults.hourMax = this.hourMaxOriginal;
[654] Fix | Delete
this._defaults.minuteMax = this.minuteMaxOriginal;
[655] Fix | Delete
this._defaults.secondMax = this.secondMaxOriginal;
[656] Fix | Delete
this._defaults.millisecMax = this.millisecMaxOriginal;
[657] Fix | Delete
this._defaults.microsecMax = this.microsecMaxOriginal;
[658] Fix | Delete
}
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
if (adjustSliders !== undefined && adjustSliders === true) {
[662] Fix | Delete
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
[663] Fix | Delete
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
[664] Fix | Delete
secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
[665] Fix | Delete
millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),
[666] Fix | Delete
microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);
[667] Fix | Delete
[668] Fix | Delete
if (this.hour_slider) {
[669] Fix | Delete
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
[670] Fix | Delete
this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
[671] Fix | Delete
}
[672] Fix | Delete
if (this.minute_slider) {
[673] Fix | Delete
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
[674] Fix | Delete
this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
[675] Fix | Delete
}
[676] Fix | Delete
if (this.second_slider) {
[677] Fix | Delete
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
[678] Fix | Delete
this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
[679] Fix | Delete
}
[680] Fix | Delete
if (this.millisec_slider) {
[681] Fix | Delete
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
[682] Fix | Delete
this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
[683] Fix | Delete
}
[684] Fix | Delete
if (this.microsec_slider) {
[685] Fix | Delete
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax });
[686] Fix | Delete
this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
[687] Fix | Delete
}
[688] Fix | Delete
}
[689] Fix | Delete
[690] Fix | Delete
},
[691] Fix | Delete
[692] Fix | Delete
/*
[693] Fix | Delete
* when a slider moves, set the internal time...
[694] Fix | Delete
* on time change is also called when the time is updated in the text field
[695] Fix | Delete
*/
[696] Fix | Delete
_onTimeChange: function () {
[697] Fix | Delete
if (!this._defaults.showTimepicker) {
[698] Fix | Delete
return;
[699] Fix | Delete
}
[700] Fix | Delete
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
[701] Fix | Delete
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
[702] Fix | Delete
second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
[703] Fix | Delete
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
[704] Fix | Delete
microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,
[705] Fix | Delete
timezone = (this.timezone_select) ? this.timezone_select.val() : false,
[706] Fix | Delete
o = this._defaults,
[707] Fix | Delete
pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
[708] Fix | Delete
pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
[709] Fix | Delete
[710] Fix | Delete
if (typeof(hour) === 'object') {
[711] Fix | Delete
hour = false;
[712] Fix | Delete
}
[713] Fix | Delete
if (typeof(minute) === 'object') {
[714] Fix | Delete
minute = false;
[715] Fix | Delete
}
[716] Fix | Delete
if (typeof(second) === 'object') {
[717] Fix | Delete
second = false;
[718] Fix | Delete
}
[719] Fix | Delete
if (typeof(millisec) === 'object') {
[720] Fix | Delete
millisec = false;
[721] Fix | Delete
}
[722] Fix | Delete
if (typeof(microsec) === 'object') {
[723] Fix | Delete
microsec = false;
[724] Fix | Delete
}
[725] Fix | Delete
if (typeof(timezone) === 'object') {
[726] Fix | Delete
timezone = false;
[727] Fix | Delete
}
[728] Fix | Delete
[729] Fix | Delete
if (hour !== false) {
[730] Fix | Delete
hour = parseInt(hour, 10);
[731] Fix | Delete
}
[732] Fix | Delete
if (minute !== false) {
[733] Fix | Delete
minute = parseInt(minute, 10);
[734] Fix | Delete
}
[735] Fix | Delete
if (second !== false) {
[736] Fix | Delete
second = parseInt(second, 10);
[737] Fix | Delete
}
[738] Fix | Delete
if (millisec !== false) {
[739] Fix | Delete
millisec = parseInt(millisec, 10);
[740] Fix | Delete
}
[741] Fix | Delete
if (microsec !== false) {
[742] Fix | Delete
microsec = parseInt(microsec, 10);
[743] Fix | Delete
}
[744] Fix | Delete
if (timezone !== false) {
[745] Fix | Delete
timezone = timezone.toString();
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
[749] Fix | Delete
[750] Fix | Delete
// If the update was done in the input field, the input field should not be updated.
[751] Fix | Delete
// If the update was done using the sliders, update the input field.
[752] Fix | Delete
var hasChanged = (
[753] Fix | Delete
hour !== parseInt(this.hour,10) || // sliders should all be numeric
[754] Fix | Delete
minute !== parseInt(this.minute,10) ||
[755] Fix | Delete
second !== parseInt(this.second,10) ||
[756] Fix | Delete
millisec !== parseInt(this.millisec,10) ||
[757] Fix | Delete
microsec !== parseInt(this.microsec,10) ||
[758] Fix | Delete
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
[759] Fix | Delete
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
[760] Fix | Delete
);
[761] Fix | Delete
[762] Fix | Delete
if (hasChanged) {
[763] Fix | Delete
[764] Fix | Delete
if (hour !== false) {
[765] Fix | Delete
this.hour = hour;
[766] Fix | Delete
}
[767] Fix | Delete
if (minute !== false) {
[768] Fix | Delete
this.minute = minute;
[769] Fix | Delete
}
[770] Fix | Delete
if (second !== false) {
[771] Fix | Delete
this.second = second;
[772] Fix | Delete
}
[773] Fix | Delete
if (millisec !== false) {
[774] Fix | Delete
this.millisec = millisec;
[775] Fix | Delete
}
[776] Fix | Delete
if (microsec !== false) {
[777] Fix | Delete
this.microsec = microsec;
[778] Fix | Delete
}
[779] Fix | Delete
if (timezone !== false) {
[780] Fix | Delete
this.timezone = timezone;
[781] Fix | Delete
}
[782] Fix | Delete
[783] Fix | Delete
if (!this.inst) {
[784] Fix | Delete
this.inst = $.datepicker._getInst(this.$input[0]);
[785] Fix | Delete
}
[786] Fix | Delete
[787] Fix | Delete
this._limitMinMaxDateTime(this.inst, true);
[788] Fix | Delete
}
[789] Fix | Delete
if (this.support.ampm) {
[790] Fix | Delete
this.ampm = ampm;
[791] Fix | Delete
}
[792] Fix | Delete
[793] Fix | Delete
// Updates the time within the timepicker
[794] Fix | Delete
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
[795] Fix | Delete
if (this.$timeObj) {
[796] Fix | Delete
if (pickerTimeFormat === o.timeFormat) {
[797] Fix | Delete
this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
[798] Fix | Delete
}
[799] Fix | Delete
else {
[800] Fix | Delete
this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
[801] Fix | Delete
}
[802] Fix | Delete
}
[803] Fix | Delete
[804] Fix | Delete
this.timeDefined = true;
[805] Fix | Delete
if (hasChanged) {
[806] Fix | Delete
this._updateDateTime();
[807] Fix | Delete
this.$input.focus();
[808] Fix | Delete
}
[809] Fix | Delete
},
[810] Fix | Delete
[811] Fix | Delete
/*
[812] Fix | Delete
* call custom onSelect.
[813] Fix | Delete
* bind to sliders slidestop, and grid click.
[814] Fix | Delete
*/
[815] Fix | Delete
_onSelectHandler: function () {
[816] Fix | Delete
var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
[817] Fix | Delete
var inputEl = this.$input ? this.$input[0] : null;
[818] Fix | Delete
if (onSelect && inputEl) {
[819] Fix | Delete
onSelect.apply(inputEl, [this.formattedDateTime, this]);
[820] Fix | Delete
}
[821] Fix | Delete
},
[822] Fix | Delete
[823] Fix | Delete
/*
[824] Fix | Delete
* update our input with the new date time..
[825] Fix | Delete
*/
[826] Fix | Delete
_updateDateTime: function (dp_inst) {
[827] Fix | Delete
dp_inst = this.inst || dp_inst;
[828] Fix | Delete
var dtTmp = (dp_inst.currentYear > 0?
[829] Fix | Delete
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
[830] Fix | Delete
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
[831] Fix | Delete
dt = $.datepicker._daylightSavingAdjust(dtTmp),
[832] Fix | Delete
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
[833] Fix | Delete
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
[834] Fix | Delete
dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
[835] Fix | Delete
formatCfg = $.datepicker._getFormatConfig(dp_inst),
[836] Fix | Delete
timeAvailable = dt !== null && this.timeDefined;
[837] Fix | Delete
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
[838] Fix | Delete
var formattedDateTime = this.formattedDate;
[839] Fix | Delete
[840] Fix | Delete
// if a slider was changed but datepicker doesn't have a value yet, set it
[841] Fix | Delete
if (dp_inst.lastVal === "") {
[842] Fix | Delete
dp_inst.currentYear = dp_inst.selectedYear;
[843] Fix | Delete
dp_inst.currentMonth = dp_inst.selectedMonth;
[844] Fix | Delete
dp_inst.currentDay = dp_inst.selectedDay;
[845] Fix | Delete
}
[846] Fix | Delete
[847] Fix | Delete
/*
[848] Fix | Delete
* remove following lines to force every changes in date picker to change the input value
[849] Fix | Delete
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
[850] Fix | Delete
* If the user manually empty the value in the input field, the date picker will never change selected value.
[851] Fix | Delete
*/
[852] Fix | Delete
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
[853] Fix | Delete
// return;
[854] Fix | Delete
//}
[855] Fix | Delete
[856] Fix | Delete
if (this._defaults.timeOnly === true) {
[857] Fix | Delete
formattedDateTime = this.formattedTime;
[858] Fix | Delete
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
[859] Fix | Delete
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
[860] Fix | Delete
}
[861] Fix | Delete
[862] Fix | Delete
this.formattedDateTime = formattedDateTime;
[863] Fix | Delete
[864] Fix | Delete
if (!this._defaults.showTimepicker) {
[865] Fix | Delete
this.$input.val(this.formattedDate);
[866] Fix | Delete
} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
[867] Fix | Delete
this.$altInput.val(this.formattedTime);
[868] Fix | Delete
this.$input.val(this.formattedDate);
[869] Fix | Delete
} else if (this.$altInput) {
[870] Fix | Delete
this.$input.val(formattedDateTime);
[871] Fix | Delete
var altFormattedDateTime = '',
[872] Fix | Delete
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
[873] Fix | Delete
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
[874] Fix | Delete
[875] Fix | Delete
if (!this._defaults.timeOnly) {
[876] Fix | Delete
if (this._defaults.altFormat) {
[877] Fix | Delete
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
[878] Fix | Delete
}
[879] Fix | Delete
else {
[880] Fix | Delete
altFormattedDateTime = this.formattedDate;
[881] Fix | Delete
}
[882] Fix | Delete
[883] Fix | Delete
if (altFormattedDateTime) {
[884] Fix | Delete
altFormattedDateTime += altSeparator;
[885] Fix | Delete
}
[886] Fix | Delete
}
[887] Fix | Delete
[888] Fix | Delete
if (this._defaults.altTimeFormat) {
[889] Fix | Delete
altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
[890] Fix | Delete
}
[891] Fix | Delete
else {
[892] Fix | Delete
altFormattedDateTime += this.formattedTime + altTimeSuffix;
[893] Fix | Delete
}
[894] Fix | Delete
this.$altInput.val(altFormattedDateTime);
[895] Fix | Delete
} else {
[896] Fix | Delete
this.$input.val(formattedDateTime);
[897] Fix | Delete
}
[898] Fix | Delete
[899] Fix | Delete
this.$input.trigger("change");
[900] Fix | Delete
},
[901] Fix | Delete
[902] Fix | Delete
_onFocus: function () {
[903] Fix | Delete
if (!this.$input.val() && this._defaults.defaultValue) {
[904] Fix | Delete
this.$input.val(this._defaults.defaultValue);
[905] Fix | Delete
var inst = $.datepicker._getInst(this.$input.get(0)),
[906] Fix | Delete
tp_inst = $.datepicker._get(inst, 'timepicker');
[907] Fix | Delete
if (tp_inst) {
[908] Fix | Delete
if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
[909] Fix | Delete
try {
[910] Fix | Delete
$.datepicker._updateDatepicker(inst);
[911] Fix | Delete
} catch (err) {
[912] Fix | Delete
$.timepicker.log(err);
[913] Fix | Delete
}
[914] Fix | Delete
}
[915] Fix | Delete
}
[916] Fix | Delete
}
[917] Fix | Delete
},
[918] Fix | Delete
[919] Fix | Delete
/*
[920] Fix | Delete
* Small abstraction to control types
[921] Fix | Delete
* We can add more, just be sure to follow the pattern: create, options, value
[922] Fix | Delete
*/
[923] Fix | Delete
_controls: {
[924] Fix | Delete
// slider methods
[925] Fix | Delete
slider: {
[926] Fix | Delete
create: function (tp_inst, obj, unit, val, min, max, step) {
[927] Fix | Delete
var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
[928] Fix | Delete
return obj.prop('slide', null).slider({
[929] Fix | Delete
orientation: "horizontal",
[930] Fix | Delete
value: rtl ? val * -1 : val,
[931] Fix | Delete
min: rtl ? max * -1 : min,
[932] Fix | Delete
max: rtl ? min * -1 : max,
[933] Fix | Delete
step: step,
[934] Fix | Delete
slide: function (event, ui) {
[935] Fix | Delete
tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
[936] Fix | Delete
tp_inst._onTimeChange();
[937] Fix | Delete
},
[938] Fix | Delete
stop: function (event, ui) {
[939] Fix | Delete
tp_inst._onSelectHandler();
[940] Fix | Delete
}
[941] Fix | Delete
});
[942] Fix | Delete
},
[943] Fix | Delete
options: function (tp_inst, obj, unit, opts, val) {
[944] Fix | Delete
if (tp_inst._defaults.isRTL) {
[945] Fix | Delete
if (typeof(opts) === 'string') {
[946] Fix | Delete
if (opts === 'min' || opts === 'max') {
[947] Fix | Delete
if (val !== undefined) {
[948] Fix | Delete
return obj.slider(opts, val * -1);
[949] Fix | Delete
}
[950] Fix | Delete
return Math.abs(obj.slider(opts));
[951] Fix | Delete
}
[952] Fix | Delete
return obj.slider(opts);
[953] Fix | Delete
}
[954] Fix | Delete
var min = opts.min,
[955] Fix | Delete
max = opts.max;
[956] Fix | Delete
opts.min = opts.max = null;
[957] Fix | Delete
if (min !== undefined) {
[958] Fix | Delete
opts.max = min * -1;
[959] Fix | Delete
}
[960] Fix | Delete
if (max !== undefined) {
[961] Fix | Delete
opts.min = max * -1;
[962] Fix | Delete
}
[963] Fix | Delete
return obj.slider(opts);
[964] Fix | Delete
}
[965] Fix | Delete
if (typeof(opts) === 'string' && val !== undefined) {
[966] Fix | Delete
return obj.slider(opts, val);
[967] Fix | Delete
}
[968] Fix | Delete
return obj.slider(opts);
[969] Fix | Delete
},
[970] Fix | Delete
value: function (tp_inst, obj, unit, val) {
[971] Fix | Delete
if (tp_inst._defaults.isRTL) {
[972] Fix | Delete
if (val !== undefined) {
[973] Fix | Delete
return obj.slider('value', val * -1);
[974] Fix | Delete
}
[975] Fix | Delete
return Math.abs(obj.slider('value'));
[976] Fix | Delete
}
[977] Fix | Delete
if (val !== undefined) {
[978] Fix | Delete
return obj.slider('value', val);
[979] Fix | Delete
}
[980] Fix | Delete
return obj.slider('value');
[981] Fix | Delete
}
[982] Fix | Delete
},
[983] Fix | Delete
// select methods
[984] Fix | Delete
select: {
[985] Fix | Delete
create: function (tp_inst, obj, unit, val, min, max, step) {
[986] Fix | Delete
var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
[987] Fix | Delete
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
[988] Fix | Delete
[989] Fix | Delete
for (var i = min; i <= max; i += step) {
[990] Fix | Delete
sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
[991] Fix | Delete
if (unit === 'hour') {
[992] Fix | Delete
sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);
[993] Fix | Delete
}
[994] Fix | Delete
else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
[995] Fix | Delete
else {sel += '0' + i.toString(); }
[996] Fix | Delete
sel += '</option>';
[997] Fix | Delete
}
[998] Fix | Delete
sel += '</select>';
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function