aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker
diff options
context:
space:
mode:
authorpheiberg <peter@heiberg.se>2010-11-21 22:06:23 +0100
committerScott González <scott.gonzalez@gmail.com>2010-11-22 08:29:29 -0500
commitd69f2ecb1273f382d83b13c349a8c76b17bee2a6 (patch)
tree21aa2006d1f5a9f38e38d77edd39860898b130c3 /tests/unit/datepicker
parent3361e8fe9d94792c399654312d0ee2cf2c8cfe73 (diff)
downloadjquery-ui-d69f2ecb1273f382d83b13c349a8c76b17bee2a6.tar.gz
jquery-ui-d69f2ecb1273f382d83b13c349a8c76b17bee2a6.zip
Datepicker: changed setDate not to modify the passed date argument. Fixes #6671 - setDate manipulates its argument
Diffstat (limited to 'tests/unit/datepicker')
-rw-r--r--tests/unit/datepicker/datepicker_options.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 5b5f252cc..af561a783 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -470,6 +470,10 @@ test('setDate', function() {
equalsDate(inp.datepicker('getDate'), minDate, 'Set date min/max - setDate < min');
inp.datepicker('setDate', date2);
equalsDate(inp.datepicker('getDate'), maxDate, 'Set date min/max - setDate > max');
+ var dateAndTimeToSet = new Date(2008, 3 - 1, 28, 1, 11, 0);
+ 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('altField', function() {