]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fixed one o'clock bug for Galician with calendar. 224/head
authorRocky Meza <rocky@fusionbox.com>
Fri, 23 Mar 2012 07:44:39 +0000 (01:44 -0600)
committerRocky Meza <rocky@fusionbox.com>
Fri, 23 Mar 2012 07:44:39 +0000 (01:44 -0600)
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
test/lang/gl.js

index c394d1f321e9af54b5647cd7ba6ee1a6924af1e5..ccde1d3828833df5f486a08c1f913abc70f2bf86 100644 (file)
@@ -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'
             },
index 199fcdbc616b150c908c4a095a9f072aa5e63539..4e36ec59e3c883ca4b75f8ba58648c247f9514cf 100644 (file)
@@ -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
+};