MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / checkWeekday

Function checkWeekday

tests/test_code/js/moment/moment.js:2449–2465  ·  view source on GitHub ↗
(weekdayStr, parsedInput, config)

Source from the content-addressed store, hash-verified

2447 }
2448
2449 function checkWeekday(weekdayStr, parsedInput, config) {
2450 if (weekdayStr) {
2451 // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
2452 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
2453 weekdayActual = new Date(
2454 parsedInput[0],
2455 parsedInput[1],
2456 parsedInput[2]
2457 ).getDay();
2458 if (weekdayProvided !== weekdayActual) {
2459 getParsingFlags(config).weekdayMismatch = true;
2460 config._isValid = false;
2461 return false;
2462 }
2463 }
2464 return true;
2465 }
2466
2467 function calculateOffset(obsOffset, militaryOffset, numOffset) {
2468 if (obsOffset) {

Callers 1

configFromRFC2822Function · 0.85

Calls 1

getParsingFlagsFunction · 0.85

Tested by

no test coverage detected