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

Function listWeekdaysImpl

tests/test_code/js/moment/moment.js:5067–5101  ·  view source on GitHub ↗
(localeSorted, format, index, field)

Source from the content-addressed store, hash-verified

5065 // (true, fmt, 5)
5066 // (true, fmt)
5067 function listWeekdaysImpl(localeSorted, format, index, field) {
5068 if (typeof localeSorted === 'boolean') {
5069 if (isNumber(format)) {
5070 index = format;
5071 format = undefined;
5072 }
5073
5074 format = format || '';
5075 } else {
5076 format = localeSorted;
5077 index = format;
5078 localeSorted = false;
5079
5080 if (isNumber(format)) {
5081 index = format;
5082 format = undefined;
5083 }
5084
5085 format = format || '';
5086 }
5087
5088 var locale = getLocale(),
5089 shift = localeSorted ? locale._week.dow : 0,
5090 i,
5091 out = [];
5092
5093 if (index != null) {
5094 return get$1(format, (index + shift) % 7, field, 'day');
5095 }
5096
5097 for (i = 0; i < 7; i++) {
5098 out[i] = get$1(format, (i + shift) % 7, field, 'day');
5099 }
5100 return out;
5101 }
5102
5103 function listMonths(format, index) {
5104 return listMonthsImpl(format, index, 'months');

Callers 3

listWeekdaysFunction · 0.85
listWeekdaysShortFunction · 0.85
listWeekdaysMinFunction · 0.85

Calls 3

isNumberFunction · 0.85
getLocaleFunction · 0.85
get$1Function · 0.85

Tested by

no test coverage detected