]> 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:27:04 +0000 (08:27 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 9 Aug 2011 12:27:04 +0000 (08:27 -0400)
This reverts commit b8e14e79e5bc630bf459137896c08fc37936f52f.

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

index 15005c8bee1b12beed5286f28740afbe0ea28ecc..e863b5362b9ff632adb2617f40b7c1cd437440a3 100644 (file)
@@ -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() {
index 00ce5850d9bda10549e6f7e07ecd75a3cf39d85b..df6bdd41969ec00d55285a7bfa233264be4c7d67 100644 (file)
@@ -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. */