Skip to content

Commit 51a6ade

Browse files
committed
Fixed issue #84
1 parent 93aaf1e commit 51a6ade

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

strftime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@
649649
// '70'
650650
// case 'y':
651651
case 121:
652-
resultString += ('' + date.getFullYear()).slice(2);
652+
resultString += ('' + date.getFullYear()).slice(padding === "" ? 3 : 2);
653653
break;
654654

655655
// '+0000'

test.js

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ assert.format('%k', null, '18');
100100
assert.format('%L', '067');
101101
assert.format('%l', null, ' 6');
102102
assert.format('%-l', null, '6');
103+
assert.format("%-y", "1", null, new Date('2001-02-03T04:05:06'))
103104
assert.format('%_l', null, ' 6');
104105
assert.format('%0l', null, '06');
105106
assert.format('%M', null, '51');

0 commit comments

Comments
 (0)