aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2009-07-22 08:28:01 +0000
committerKeith Wood <kbwood.au@gmail.com>2009-07-22 08:28:01 +0000
commit61e15b1f76e27596b41d95b2b18c5df7f9eaa89f (patch)
tree669934ca59eceb4da3edc368d5662874bc7c2ca1 /tests
parent269a4412683dbb05d02de02fb7dd98e23d373ebb (diff)
downloadjquery-ui-61e15b1f76e27596b41d95b2b18c5df7f9eaa89f.tar.gz
jquery-ui-61e15b1f76e27596b41d95b2b18c5df7f9eaa89f.zip
Datepicker: Fixed #4647 setDate cannot be called multiple times
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/datepicker/datepicker_options.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 0a111a93c..768f43c27 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -404,6 +404,17 @@ test('setDate', function() {
equalsDate(inp.datepicker('getDate'), date1, 'Set date - two dates');
inp.datepicker('setDate');
ok(inp.datepicker('getDate') == null, 'Set date - null');
+ // Relative to current date
+ date1 = new Date();
+ date1.setDate(date1.getDate() + 7);
+ inp.datepicker('setDate', 'c +7');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c +7');
+ date1.setDate(date1.getDate() + 7);
+ inp.datepicker('setDate', 'c+7');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c+7');
+ date1.setDate(date1.getDate() - 21);
+ inp.datepicker('setDate', 'c -3 w');
+ equalsDate(inp.datepicker('getDate'), date1, 'Set date - c -3 w');
// Inline
var inl = init('#inl');
date1 = new Date(2008, 6 - 1, 4);