Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Datepicker: More zero-padding formatDate tests with years 0-99
  • Loading branch information
MoonE committed Mar 14, 2026
commit 7df6e5275c76e493d6416ca740a1b0248a5423a2
5 changes: 4 additions & 1 deletion tests/unit/datepicker/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ QUnit.test( "Ticket #7244: date parser does not fail when too many numbers are p
} );

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

assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 0, 0, 1 ) ), "0000-01-01" );
assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 12, 0, 1 ) ), "0012-01-01" );
assert.equal( $.datepicker.formatDate( "yy-mm-dd", $.datepicker._createDate( 99, 0, 1 ) ), "0099-01-01" );
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 100, 0, 1 ) ), "0100-01-01" );
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 999, 0, 1 ) ), "0999-01-01" );
assert.equal( $.datepicker.formatDate( "yy-mm-dd", new Date( 1000, 0, 1 ) ), "1000-01-01" );
Expand Down