From: Eric Hartford Date: Tue, 26 Nov 2013 19:18:47 +0000 (-0800) Subject: Change quarter format string to upper case Q X-Git-Tag: 2.5.0^2~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b62452ab53a309de84225ca0a860b201a2c86c4;p=thirdparty%2Fmoment.git Change quarter format string to upper case Q --- diff --git a/moment.js b/moment.js index 6ca67035e..72b357eaa 100644 --- a/moment.js +++ b/moment.js @@ -247,7 +247,7 @@ X : function () { return this.unix(); }, - q : function () { + Q : function () { return this.quarterOfYear(); } }, diff --git a/test/moment/format.js b/test/moment/format.js index 0a6f158c8..64cb84ac7 100644 --- a/test/moment/format.js +++ b/test/moment/format.js @@ -344,13 +344,13 @@ exports.format = { "quarter formats" : function (test) { test.expect(7); - test.equal(moment([1985, 1, 4]).format('q'), '1', "Feb 4 1985 is Q1"); - test.equal(moment([2029, 8, 18]).format('q'), '3', "Sep 18 2029 is Q3"); - test.equal(moment([2013, 3, 24]).format('q'), '2', "Apr 24 2013 is Q2"); - test.equal(moment([2015, 2, 5]).format('q'), '1', "Mar 5 2015 is Q1"); - test.equal(moment([1970, 0, 2]).format('q'), '1', "Jan 2 1970 is Q1"); - test.equal(moment([2001, 11, 12]).format('q'), '4', "Dec 12 2001 is Q4"); - test.equal(moment([2000, 0, 2]).format('q'), '1', "Jan 2 2000 is Q1"); + test.equal(moment([1985, 1, 4]).format('Q'), '1', "Feb 4 1985 is Q1"); + test.equal(moment([2029, 8, 18]).format('Q'), '3', "Sep 18 2029 is Q3"); + test.equal(moment([2013, 3, 24]).format('Q'), '2', "Apr 24 2013 is Q2"); + test.equal(moment([2015, 2, 5]).format('Q'), '1', "Mar 5 2015 is Q1"); + test.equal(moment([1970, 0, 2]).format('Q'), '1', "Jan 2 1970 is Q1"); + test.equal(moment([2001, 11, 12]).format('Q'), '4', "Dec 12 2001 is Q4"); + test.equal(moment([2000, 0, 2]).format('[Q]Q-YYYY'), 'Q1-2000', "Jan 2 2000 is Q1"); test.done(); }