]> source.dussan.org Git - jquery-ui.git/commitdiff
Revert "Datepicker: Added onSelect.apply() call to _setDate method if onSelect is...
authorScott González <scott.gonzalez@gmail.com>
Tue, 9 Aug 2011 12:26:33 +0000 (08:26 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 9 Aug 2011 12:26:33 +0000 (08:26 -0400)
This reverts commit effdd5d19c534f8445ebafe4212278c4366b0041.

tests/unit/datepicker/datepicker_options.js
ui/jquery.ui.datepicker.js

index 0a3d5cdac33b4fcf01401b1aaae6b9b40d2a885b..272af9dac239b84c6b7e524ae160ef33bdb551f1 100644 (file)
@@ -469,16 +469,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() {
index b125f9457a7eb9b5936f963c880a06ac23860af1..ade580220428cbcce981f11fbf20a2182976927b 100644 (file)
@@ -1391,14 +1391,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. */