]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Style changes in parseIsoWeekday
authorIskren Chernev <iskren.chernev@gmail.com>
Tue, 14 Jun 2016 09:28:45 +0000 (02:28 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Tue, 14 Jun 2016 09:46:33 +0000 (02:46 -0700)
src/lib/units/day-of-week.js

index 3fb405a44e69cccc1ba732547d679b166eff715f..9bae45ef341fd60dce016b807b8c6321d77c1cc0 100644 (file)
@@ -89,16 +89,10 @@ function parseWeekday(input, locale) {
 }
 
 function parseIsoWeekday(input, locale) {
-    if (typeof input !== 'string' || !isNaN(input)) {
-        return parseWeekday(input, locale);
+    if (typeof input === 'string') {
+        return locale.weekdaysParse(input) % 7 || 7;
     }
-
-    input = locale.weekdaysParse(input);
-    if (typeof input === 'number') {
-        return input % 7 ? input : input + 7;
-    }
-
-    return null;
+    return isNaN(input) ? null : input;
 }
 
 // LOCALES