Skip to content

Hi i've made some changes #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Override _optionDatepicker to set time with "option" and adjust sliders
  • Loading branch information
kuzemchik committed Jul 19, 2011
commit aa9a5ca6e326780cb922b0cbbe5ea0400e78ceac
27 changes: 27 additions & 0 deletions jquery-ui-timepicker-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,33 @@ $.datepicker._getDateDatepicker = function(target, noDefault) {
return this._base_getDateDatepicker(target, noDefault);
};

//#######################################################################################
// override options setter to add time to maxDate(Time) and minDate(Time)
//#######################################################################################
$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
$.datepicker._optionDatepicker = function(target, name, value) {
this._base_optionDatepicker(target, name, value);
var inst = this._getInst(target),
tp_inst = this._get(inst, 'timepicker');
if (tp_inst) {
//Set minimum and maximum date values if we have timepicker
if(name==='minDate') {
if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date)
tp_inst._defaults.minDateTime = new Date(value);
if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date)
tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
tp_inst._limitMinMaxDateTime(inst,true);
}
if(name==='maxDate') {
if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date)
tp_inst._defaults.maxDateTime = new Date(value);
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._limitMinMaxDateTime(inst,true);
}
}
};

//#######################################################################################
// jQuery extend now ignores nulls!
//#######################################################################################
Expand Down