Skip to content

Commit 7df6e52

Browse files
committed
Datepicker: More zero-padding formatDate tests with years 0-99
1 parent 1143073 commit 7df6e52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/unit/datepicker/options.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ QUnit.test( "Ticket #7244: date parser does not fail when too many numbers are p
11241124
} );
11251125

11261126
QUnit.test( "formatDate", function( assert ) {
1127-
assert.expect( 21 );
1127+
assert.expect( 24 );
11281128
testHelper.init( "#inp" );
11291129
var gmtDate, fr, settings;
11301130
assert.equal( $.datepicker.formatDate( "d m y", new Date( 2001, 2 - 1, 3 ) ),
@@ -1165,6 +1165,9 @@ QUnit.test( "formatDate", function( assert ) {
11651165
new Date( 2001, 4 - 1, 9 ), settings ), "jour 9 de avril ('lundi'), 2001",
11661166
"Format date 'jour' d 'de' MM (''DD''), yy with settings" );
11671167

1168+
assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 0, 0, 1 ) ), "0000-01-01" );
1169+
assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 12, 0, 1 ) ), "0012-01-01" );
1170+
assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 99, 0, 1 ) ), "0099-01-01" );
11681171
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 100, 0, 1 ) ), "0100-01-01" );
11691172
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 999, 0, 1 ) ), "0999-01-01" );
11701173
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 1000, 0, 1 ) ), "1000-01-01" );

0 commit comments

Comments
 (0)