aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormarcneuwirth <marc.neuwirth@gmail.com>2011-06-28 10:59:08 -0500
committerCorey Frang <gnarf@gnarf.net>2011-06-28 10:59:08 -0500
commiteffdd5d19c534f8445ebafe4212278c4366b0041 (patch)
tree195ebacb5b097c1077b972617ad09977df3d062e /tests
parenta56aa861b1deb6d71ec74a77647d12d50570ea57 (diff)
downloadjquery-ui-effdd5d19c534f8445ebafe4212278c4366b0041.tar.gz
jquery-ui-effdd5d19c534f8445ebafe4212278c4366b0041.zip
Datepicker: Added onSelect.apply() call to _setDate method if onSelect is defined. Fixed #6264 - Datepicker: onSelect does not fire when setDate is called
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/datepicker/datepicker_options.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index a10d1ea45..107609174 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -469,6 +469,16 @@ 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() {