From: Rocky Meza Date: Fri, 23 Mar 2012 07:44:39 +0000 (-0600) Subject: Fixed one o'clock bug for Galician with calendar. X-Git-Tag: 1.5.1~9^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F224%2Fhead;p=thirdparty%2Fmoment.git Fixed one o'clock bug for Galician with calendar. I also added a regression test to be able to test this without having to wake up at 1 o'clock in the morning. --- diff --git a/lang/gl.js b/lang/gl.js index c394d1f32..ccde1d382 100644 --- a/lang/gl.js +++ b/lang/gl.js @@ -31,7 +31,7 @@ return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; }, lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : '') + '] LT'; + return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; }, sameElse : 'L' }, diff --git a/test/lang/gl.js b/test/lang/gl.js index 199fcdbc6..4e36ec59e 100644 --- a/test/lang/gl.js +++ b/test/lang/gl.js @@ -217,5 +217,16 @@ exports["lang:gl"] = { test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago"); test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks"); test.done(); + }, + + "regression tests" : function(test) { + test.expect(1); + moment.lang('gl'); + + var lastWeek = moment().subtract({ d: 4 }).hours(1); + test.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), "1 o'clock bug"); + + + test.done(); } -}; \ No newline at end of file +};