aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2008-09-07 07:55:02 +0000
committerKeith Wood <kbwood.au@gmail.com>2008-09-07 07:55:02 +0000
commit0db0ffe5804e7abc7106ad9c527620c0c9309bbb (patch)
tree7bdbf9f65a5e4d51c83ad0b405c7342faec893d4 /tests
parenteedbd524e22157a7430da60521903b64b9684183 (diff)
downloadjquery-ui-0db0ffe5804e7abc7106ad9c527620c0c9309bbb.tar.gz
jquery-ui-0db0ffe5804e7abc7106ad9c527620c0c9309bbb.zip
Fixed 3267 Alternate field not updated when using "setDate"
Diffstat (limited to 'tests')
-rw-r--r--tests/datepicker.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/datepicker.js b/tests/datepicker.js
index d79096b8a..308636baf 100644
--- a/tests/datepicker.js
+++ b/tests/datepicker.js
@@ -995,8 +995,8 @@ test('setDate', function() {
isObj(inp.datepicker('getDate'), [null, null], 'Set date range - null');
// Inline
var inl = init('#inl');
- var date1 = new Date(2008, 6 - 1, 4);
- var date2 = new Date();
+ date1 = new Date(2008, 6 - 1, 4);
+ date2 = new Date();
equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - default');
inl.datepicker('setDate', date1);
equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - 2008-06-04');
@@ -1011,6 +1011,19 @@ test('setDate', function() {
equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - two dates');
inl.datepicker('setDate');
ok(inl.datepicker('getDate') == null, 'Set date inline - null');
+ // Alternate field
+ var alt = $('#alt');
+ inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'});
+ date1 = new Date(2008, 6 - 1, 4);
+ date2 = new Date(2009, 7 - 1, 5);
+ inp.datepicker('setDate', date1, date2);
+ equals(inp.val(), '06/04/2008 - 07/05/2009',
+ 'Set date alternate - 06/04/2008 - 07/05/2009');
+ equals(alt.val(), '2008-06-04 - 2009-07-05',
+ 'Set date alternate - 2008-06-04 - 2009-07-05');
+ inp.datepicker('change', {rangeSelect: false}).datepicker('setDate', date1);
+ equals(inp.val(), '06/04/2008', 'Set date alternate - 06/04/2008');
+ equals(alt.val(), '2008-06-04', 'Set date alternate - 2008-06-04');
});
test('ranges', function() {