MCPcopy Index your code
hub / github.com/microsoft/SandDance / getUnit

Function getUnit

docs/app/js/sanddance-app.js:111295–111298  ·  view source on GitHub ↗
(f, inv, step, phase)

Source from the content-addressed store, hash-verified

111293 };
111294}
111295function 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
111300function weekday(week1, day, firstDay) {
111301 return day + week1 * 7 - (firstDay + 6) % 7;

Callers 1

_Function · 0.70

Calls 1

fFunction · 0.70

Tested by

no test coverage detected