From 95ad36b931ef23384a283f0cca24cd82eed14e40 Mon Sep 17 00:00:00 2001 From: Rocky Meza Date: Fri, 23 Mar 2012 01:44:39 -0600 Subject: [PATCH] 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. --- lang/gl.js | 2 +- test/lang/gl.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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 +}; -- 2.47.2