(localeSorted, format, index, field)
| 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'); |
no test coverage detected