aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker/datepicker_options.js
diff options
context:
space:
mode:
authorpheiberg <peter@heiberg.se>2010-11-13 22:58:07 +0100
committerScott González <scott.gonzalez@gmail.com>2010-11-18 16:13:28 -0500
commita2e0eb920aaa41e6248e1a2f7d013997ba4f421f (patch)
tree95011977f27c7d6775ee056fbd0aadbd4f29dd45 /tests/unit/datepicker/datepicker_options.js
parent859c87e6d92813c7d99c2ceeaad0ded766c820ea (diff)
downloadjquery-ui-a2e0eb920aaa41e6248e1a2f7d013997ba4f421f.tar.gz
jquery-ui-a2e0eb920aaa41e6248e1a2f7d013997ba4f421f.zip
Datepicker: Fixed parsing of single y character for date formats. Fixes #6659 - Datepicker: Date format ymmdd not parsed correctly.
Diffstat (limited to 'tests/unit/datepicker/datepicker_options.js')
-rw-r--r--tests/unit/datepicker/datepicker_options.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index b10fd95ae..5b5f252cc 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -777,12 +777,12 @@ test('parseDate', function() {
new Date(2001, 12 - 1, 13), 'Parse date d m y');
equalsDate($.datepicker.parseDate('dd mm yy', '13 12 2001'),
new Date(2001, 12 - 1, 13), 'Parse date dd mm yy');
- equalsDate($.datepicker.parseDate('y-o', '2001-34'),
+ equalsDate($.datepicker.parseDate('y-o', '01-34'),
new Date(2001, 2 - 1, 3), 'Parse date y-o');
equalsDate($.datepicker.parseDate('yy-oo', '2001-347'),
- new Date(2001, 12 - 1, 13), 'Parse date yy oo');
+ new Date(2001, 12 - 1, 13), 'Parse date yy-oo');
equalsDate($.datepicker.parseDate('oo yy', '348 2004'),
- new Date(2004, 12 - 1, 13), 'Parse date oo-yy');
+ new Date(2004, 12 - 1, 13), 'Parse date oo yy');
equalsDate($.datepicker.parseDate('D d M y', 'Sat 3 Feb 01'),
new Date(2001, 2 - 1, 3), 'Parse date D d M y');
equalsDate($.datepicker.parseDate('d MM DD yy', '3 February Saturday 2001'),
@@ -792,6 +792,8 @@ test('parseDate', function() {
equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3),
'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy');
+ equalsDate($.datepicker.parseDate('ymmdd', '010203'),
+ new Date(2001, 2 - 1, 3), 'Parse date ymmdd - default cutoff');
equalsDate($.datepicker.parseDate('y-m-d', '01-02-03'),
new Date(2001, 2 - 1, 3), 'Parse date y-m-d - default cutoff');
equalsDate($.datepicker.parseDate('y-m-d', '51-02-03'),
@@ -845,8 +847,8 @@ test('parseDateErrors', function() {
'3 2 AD01 - d m y', 'Missing number at position 4');
expectError(function() { $.datepicker.parseDate('d m yy', '3 2 AD01'); },
'3 2 AD01 - dd mm yy', 'Missing number at position 4');
- expectError(function() { $.datepicker.parseDate('y-o', '2001-D01'); },
- '2001-D01 - y-o', 'Missing number at position 5');
+ expectError(function() { $.datepicker.parseDate('y-o', '01-D01'); },
+ '2001-D01 - y-o', 'Missing number at position 3');
expectError(function() { $.datepicker.parseDate('yy-oo', '2001-D01'); },
'2001-D01 - yy-oo', 'Missing number at position 5');
expectError(function() { $.datepicker.parseDate('D d M y', 'D7 3 Feb 01'); },