]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[ar-sa] Change start of week from Saturday to Sunday
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 29 Oct 2016 01:57:03 +0000 (18:57 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 6 Nov 2016 08:59:42 +0000 (01:59 -0700)
src/locale/ar-sa.js
src/test/locale/ar-sa.js

index b6ff14e6a7d9748f461f08f4657c492e472f72b4..30a9968d6e320421600bf538d9b5b8b6827945e7 100644 (file)
@@ -88,8 +88,8 @@ export default moment.defineLocale('ar-sa', {
         }).replace(/,/g, '،');
     },
     week : {
-        dow : 6, // Saturday is the first day of the week.
-        doy : 12  // The week that contains Jan 1st is the first week of the year.
+        dow : 0, // Sunday is the first day of the week.
+        doy : 6  // The week that contains Jan 1st is the first week of the year.
     }
 });
 
index b51965695ba3d16aa60447170c2d165bd2480668..c59ade75c88cf9d809c4792933afe881a15cbecb 100644 (file)
@@ -201,17 +201,17 @@ test('calendar all else', function (assert) {
 });
 
 test('weeks year starting wednesday custom', function (assert) {
-    assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');
-    assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');
-    assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', 'Saturday of week 1 of 2003 parsed should be formatted as 2003 1 6');
-    assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0');
+    assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٣-٠١-٠٤', '2003 1 6 : gggg w d');
+    assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٩', '2003 1 0 : gggg w e');
+    assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', '2003 1 6 : gggg w d');
+    assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '2003 1 0 : gggg w e');
 });
 
 test('weeks year starting sunday formatted', function (assert) {
-    assert.equal(moment([2011, 11, 31]).format('w ww wo'), 'Ù¡ Ù Ù¡ Ù¡', 'Dec 31 2011 should be week 1');
-    assert.equal(moment([2012,  0,  6]).format('w ww wo'), '١ ٠١ ١', 'Jan  6 2012 should be week 1');
-    assert.equal(moment([2012,  0,  7]).format('w ww wo'), 'Ù¢ Ù Ù¢ Ù¢', 'Jan  7 2012 should be week 2');
-    assert.equal(moment([2012,  0, 13]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 13 2012 should be week 2');
-    assert.equal(moment([2012,  0, 14]).format('w ww wo'), 'Ù£ Ù Ù£ Ù£', 'Jan 14 2012 should be week 3');
+    assert.equal(moment([2011, 11, 31]).format('w ww wo'), '٥٣ Ù¥Ù£ Ù¥Ù£', '2011 11 31');
+    assert.equal(moment([2012,  0,  6]).format('w ww wo'), '١ ٠١ ١', '2012 0 6');
+    assert.equal(moment([2012,  0,  7]).format('w ww wo'), 'Ù¡ Ù Ù¡ Ù¡', '2012 0 7');
+    assert.equal(moment([2012,  0, 13]).format('w ww wo'), '٢ ٠٢ ٢', '2012 0 13');
+    assert.equal(moment([2012,  0, 14]).format('w ww wo'), 'Ù¢ Ù Ù¢ Ù¢', '2012 0 14');
 });