]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Update hu.js locale
authorDavid Judik <judik.david@gmail.com>
Mon, 12 Sep 2016 12:01:33 +0000 (14:01 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 6 Nov 2016 10:04:58 +0000 (02:04 -0800)
Change the first day of the year and related tests to
match the right Hungarian week of the year calculation.

src/locale/hu.js
src/test/locale/hu.js

index 875633333a8833fac99b21661d598ed329f2fe89..0cffecf836d107b16ca8c01577b15102da7e2abf 100644 (file)
@@ -94,7 +94,7 @@ export default moment.defineLocale('hu', {
     ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
-        doy : 7  // The week that contains Jan 1st is the first week of the year.
+        doy : 4  // The week that contains Jan 4th is the first week of the year.
     }
 });
 
index ff0270b96e0f32413a31868608310e9dd163c293..091902b85b9383a148e5352c39e093f5cae8d970 100644 (file)
@@ -30,7 +30,7 @@ test('format', function (assert) {
             ['D Do DD',                            '14 14. 14'],
             ['d do dddd ddd dd',                   '0 0. vasárnap vas v'],
             ['DDD DDDo DDDD',                      '45 45. 045'],
-            ['w wo ww',                            '7 7. 07'],
+            ['w wo ww',                            '6 6. 06'],
             ['H HH',                               '15 15'],
             ['m mm',                               '25 25'],
             ['s ss',                               '50 50'],
@@ -214,10 +214,10 @@ test('calendar all else', function (assert) {
 });
 
 test('weeks year starting sunday formatted', function (assert) {
-    assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');
-    assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');
-    assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');
-    assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');
-    assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');
+    assert.equal(moment([2011, 11, 26]).format('w ww wo'), '52 52 52.', 'Dec 26 2011 should be week 52');
+    assert.equal(moment([2012,  0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');
+    assert.equal(moment([2012,  0,  2]).format('w ww wo'), '1 01 1.', 'Jan  2 2012 should be week 1');
+    assert.equal(moment([2012,  0,  8]).format('w ww wo'), '1 01 1.', 'Jan  8 2012 should be week 1');
+    assert.equal(moment([2012,  0,  9]).format('w ww wo'), '2 02 2.', 'Jan  9 2012 should be week 2');
 });