diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/moment/src/lib/create | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/moment/src/lib/create')
-rw-r--r-- | node_modules/moment/src/lib/create/from-array.js | 6 | ||||
-rw-r--r-- | node_modules/moment/src/lib/create/from-string.js | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/node_modules/moment/src/lib/create/from-array.js b/node_modules/moment/src/lib/create/from-array.js index 7626c455d..b5a0911de 100644 --- a/node_modules/moment/src/lib/create/from-array.js +++ b/node_modules/moment/src/lib/create/from-array.js @@ -21,7 +21,7 @@ function currentDateArray(config) { // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] export function configFromArray (config) { - var i, date, input = [], currentDate, yearToUse; + var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; @@ -71,6 +71,8 @@ export function configFromArray (config) { } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); + // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { @@ -82,7 +84,7 @@ export function configFromArray (config) { } // check for mismatching day of week - if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) { + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { getParsingFlags(config).weekdayMismatch = true; } } diff --git a/node_modules/moment/src/lib/create/from-string.js b/node_modules/moment/src/lib/create/from-string.js index 7c1052a3e..c5ad56bab 100644 --- a/node_modules/moment/src/lib/create/from-string.js +++ b/node_modules/moment/src/lib/create/from-string.js @@ -128,7 +128,7 @@ function untruncateYear(yearStr) { function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space - return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim(); + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { |