diff --git a/Source/Types/Date.js b/Source/Types/Date.js index 69b1bcad..d67eb0e5 100644 --- a/Source/Types/Date.js +++ b/Source/Types/Date.js @@ -235,6 +235,7 @@ Date.implement({ case 'L': return pad(d.get('ms'), 3); case 'm': return pad((d.get('mo') + 1), 2); case 'M': return pad(d.get('min'), 2); + case 'n': return (d.get('mo') + 1); case 'o': return d.get('ordinal'); case 'p': return Date.getMsg(d.get('ampm')); case 's': return Math.round(d / 1000); diff --git a/Specs/Types/Date.js b/Specs/Types/Date.js index 2f30dbc1..5bd09138 100644 --- a/Specs/Types/Date.js +++ b/Specs/Types/Date.js @@ -421,9 +421,12 @@ describe('Date', function(){ it('should return the month number as two digits', function(){ expect(d.format('%m')).toEqual('11'); }); - it('should return the minutes as two digits', function(){ + it('should return the minutes as two digits', function(){ expect(d.format('%M')).toEqual('02'); }); + it('should return the month as one digit', function(){ + expect(d.format('%n')).toEqual('2'); + }); it('should return the ordinal, and should be the same as .getOridnal', function(){ expect(d.format('%o')).toEqual(d.get('ordinal')); });