Fixed issue #84

This commit is contained in:
aryan-debug 2023-05-21 22:14:09 -07:00
parent 6157e8a650
commit b50d512dee
2 changed files with 3 additions and 1 deletions

View file

@ -649,7 +649,8 @@
// '70'
// case 'y':
case 121:
resultString += ('' + date.getFullYear()).slice(padding === "" ? 3 : 2);
let year_without_century = ('' + date.getFullYear()).slice(2)
resultString += year_without_century.slice(padding === "" && year_without_century.charAt(0) === "0" ? 1 : 0);
break;
// '+0000'

View file

@ -101,6 +101,7 @@ assert.format('%L', '067');
assert.format('%l', null, ' 6');
assert.format('%-l', null, '6');
assert.format("%-y", "1", null, new Date('2001-02-03T04:05:06'))
assert.format("%-y", "23", null, new Date('2023-02-03T04:05:06'))
assert.format('%_l', null, ' 6');
assert.format('%0l', null, '06');
assert.format('%M', null, '51');