diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-28 16:41:36 -0500 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-28 16:41:36 -0500 |
commit | 96de2aa04a4e323199ac942b086958d7227f879a (patch) | |
tree | 91a42d2b84c117d218636bd8e4045bf937f7e7c2 /tests | |
parent | effdd5d19c534f8445ebafe4212278c4366b0041 (diff) | |
parent | 76e2b98a312cfab3d754aac5068ad965e544840c (diff) | |
download | jquery-ui-96de2aa04a4e323199ac942b086958d7227f879a.tar.gz jquery-ui-96de2aa04a4e323199ac942b086958d7227f879a.zip |
Merge remote branch 'pgraham/master'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/datepicker/datepicker_tickets.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/unit/datepicker/datepicker_tickets.js b/tests/unit/datepicker/datepicker_tickets.js index d5249f905..10647eb13 100644 --- a/tests/unit/datepicker/datepicker_tickets.js +++ b/tests/unit/datepicker/datepicker_tickets.js @@ -30,12 +30,22 @@ test('Ticket 6827: formatDate day of year calculation is wrong during day lights }); test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() { - expect(1); + var date; try{ - var date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881'); + date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881'); + ok(false, "Did not properly detect an invalid date"); }catch(e){ ok("invalid date detected"); } + + try { + date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm'); + equal(date.getDate(), 18); + equal(date.getMonth(), 3); + equal(date.getFullYear(), 1988); + } catch(e) { + ok(false, "Did not properly parse date with extra text separated by whitespace"); + } }); })(jQuery); |