From f9cd922dc4d4fa1459d802a4479bfd3ad9dc217d Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Tue, 14 Jun 2016 02:28:45 -0700 Subject: [PATCH] Style changes in parseIsoWeekday --- src/lib/units/day-of-week.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 -- 2.47.2