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

Function getSetISODayOfWeek

tests/test_code/js/moment/moment.js:1732–1747  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

1730 }
1731
1732 function getSetISODayOfWeek(input) {
1733 if (!this.isValid()) {
1734 return input != null ? this : NaN;
1735 }
1736
1737 // behaves the same as moment#day except
1738 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
1739 // as a setter, sunday should belong to the previous week.
1740
1741 if (input != null) {
1742 var weekday = parseIsoWeekday(input, this.localeData());
1743 return this.day(this.day() % 7 ? weekday : weekday - 7);
1744 } else {
1745 return this.day() || 7;
1746 }
1747 }
1748
1749 function weekdaysRegex(isStrict) {
1750 if (this._weekdaysParseExact) {

Callers

nothing calls this directly

Calls 1

parseIsoWeekdayFunction · 0.85

Tested by

no test coverage detected