Cleaing some whitespace
Fixing show/hide time for calendar use case
This commit is contained in:
parent
4bca74de36
commit
c9be5b72e7
7
jquery-ui-timepicker-addon.js
vendored
7
jquery-ui-timepicker-addon.js
vendored
|
@ -516,6 +516,8 @@ $.extend(Timepicker.prototype, {
|
||||||
var o = this._defaults,
|
var o = this._defaults,
|
||||||
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
|
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
|
||||||
|
|
||||||
|
if(!this._defaults.showTimepicker) return; // No time so nothing to check here
|
||||||
|
|
||||||
if(this._defaults.minDateTime !== null && dp_date){
|
if(this._defaults.minDateTime !== null && dp_date){
|
||||||
var minDateTime = this._defaults.minDateTime,
|
var minDateTime = this._defaults.minDateTime,
|
||||||
minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
|
minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
|
||||||
|
@ -859,9 +861,9 @@ $.datepicker._gotoToday = function(id) {
|
||||||
$.datepicker._disableTimepickerDatepicker = function(target, date, withDate) {
|
$.datepicker._disableTimepickerDatepicker = function(target, date, withDate) {
|
||||||
var inst = this._getInst(target),
|
var inst = this._getInst(target),
|
||||||
tp_inst = this._get(inst, 'timepicker');
|
tp_inst = this._get(inst, 'timepicker');
|
||||||
|
$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
|
||||||
if (tp_inst) {
|
if (tp_inst) {
|
||||||
tp_inst._defaults.showTimepicker = false;
|
tp_inst._defaults.showTimepicker = false;
|
||||||
tp_inst._onTimeChange();
|
|
||||||
tp_inst._updateDateTime(inst);
|
tp_inst._updateDateTime(inst);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -869,9 +871,10 @@ $.datepicker._disableTimepickerDatepicker = function(target, date, withDate) {
|
||||||
$.datepicker._enableTimepickerDatepicker = function(target, date, withDate) {
|
$.datepicker._enableTimepickerDatepicker = function(target, date, withDate) {
|
||||||
var inst = this._getInst(target),
|
var inst = this._getInst(target),
|
||||||
tp_inst = this._get(inst, 'timepicker');
|
tp_inst = this._get(inst, 'timepicker');
|
||||||
|
$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
|
||||||
if (tp_inst) {
|
if (tp_inst) {
|
||||||
tp_inst._defaults.showTimepicker = true;
|
tp_inst._defaults.showTimepicker = true;
|
||||||
tp_inst._onTimeChange();
|
tp_inst._addTimePicker(inst); // Could be disabled on page load
|
||||||
tp_inst._updateDateTime(inst);
|
tp_inst._updateDateTime(inst);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue