mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Revert "Datepicker: Added onSelect.apply() call to _setDate method if onSelect is defined. Fixed #6264 - Datepicker: onSelect does not fire when setDate is called"
This reverts commit b8e14e79e5
.
This commit is contained in:
parent
66d6766dad
commit
3e98e73772
@ -474,16 +474,6 @@ test('setDate', function() {
|
||||
var dateAndTimeClone = new Date(2008, 3 - 1, 28, 1, 11, 0);
|
||||
inp.datepicker('setDate', dateAndTimeToSet);
|
||||
equals(dateAndTimeToSet.getTime(), dateAndTimeClone.getTime(), 'Date object passed should not be changed by setDate');
|
||||
// Test onSelect callback is executed when using setDate
|
||||
inp.datepicker('destroy');
|
||||
var testDate = null;
|
||||
inp.datepicker({
|
||||
onSelect: function(dateText, inst) {
|
||||
testDate = new Date(dateText);
|
||||
}
|
||||
});
|
||||
inp.datepicker('setDate', date2);
|
||||
equals(date2.getTime(), testDate.getTime(), 'onSelect is called after setDate');
|
||||
});
|
||||
|
||||
test('altField', function() {
|
||||
|
8
ui/jquery.ui.datepicker.js
vendored
8
ui/jquery.ui.datepicker.js
vendored
@ -1384,14 +1384,6 @@ $.extend(Datepicker.prototype, {
|
||||
if (inst.input) {
|
||||
inst.input.val(clear ? '' : this._formatDate(inst));
|
||||
}
|
||||
|
||||
var onSelect = this._get(inst, 'onSelect');
|
||||
if (onSelect) {
|
||||
var dateStr = this._formatDate(inst);
|
||||
|
||||
// trigger custom callback
|
||||
onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
|
||||
}
|
||||
},
|
||||
|
||||
/* Retrieve the date(s) directly. */
|
||||
|
Loading…
Reference in New Issue
Block a user