(f, inv, step, phase)
| 111293 | }; |
| 111294 | } |
| 111295 | function getUnit(f, inv, step, phase) { |
| 111296 | const u = step <= 1 ? f : phase ? (d, y)=>phase + step * Math.floor((f(d, y) - phase) / step) : (d, y)=>step * Math.floor(f(d, y) / step); |
| 111297 | return inv ? (d, y)=>inv(u(d, y), y) : u; |
| 111298 | } // returns the day of the year based on week number, day of week, |
| 111299 | // and the day of the week for the first day of the year |
| 111300 | function weekday(week1, day, firstDay) { |
| 111301 | return day + week1 * 7 - (firstDay + 6) % 7; |