From: Iskren Chernev Date: Sun, 6 Aug 2017 23:08:32 +0000 (+0300) Subject: Fix #3724, change correct files, fix tests X-Git-Tag: 2.19.0~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c79b2cfbb51c023f8d428a44fd36f3ee8749dc1;p=thirdparty%2Fmoment.git Fix #3724, change correct files, fix tests --- diff --git a/locale/ru.js b/locale/ru.js index 023dee720..b45731e36 100644 --- a/locale/ru.js +++ b/locale/ru.js @@ -174,7 +174,7 @@ var ru = moment.defineLocale('ru', { }, week : { dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. + doy : 7 // The week that contains Jan 1st is the first week of the year. } }); diff --git a/src/locale/ru.js b/src/locale/ru.js index 633208a02..5b92fb0f7 100644 --- a/src/locale/ru.js +++ b/src/locale/ru.js @@ -168,6 +168,6 @@ export default moment.defineLocale('ru', { }, 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. } }); diff --git a/src/test/locale/ru.js b/src/test/locale/ru.js index 144167961..b7a13f691 100644 --- a/src/test/locale/ru.js +++ b/src/test/locale/ru.js @@ -43,7 +43,7 @@ test('format', function (assert) { ['D Do DD', '14 14-го 14'], ['d do dddd ddd dd', '0 0-й воскресенье вс вс'], ['DDD DDDo DDDD', '45 45-й 045'], - ['w wo ww', '7 7-я 07'], + ['w wo ww', '6 6-я 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], @@ -345,11 +345,11 @@ test('calendar all else', function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -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'); +test('weeks year starting monday formatted', function (assert) { + 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'); });