From: Iskren Chernev Date: Tue, 14 Jun 2016 09:28:45 +0000 (-0700) Subject: Style changes in parseIsoWeekday X-Git-Tag: 2.14.0~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9cd922dc4d4fa1459d802a4479bfd3ad9dc217d;p=thirdparty%2Fmoment.git Style changes in parseIsoWeekday --- diff --git a/src/lib/units/day-of-week.js b/src/lib/units/day-of-week.js index 3fb405a44..9bae45ef3 100644 --- a/src/lib/units/day-of-week.js +++ b/src/lib/units/day-of-week.js @@ -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