MCPcopy Create free account
hub / github.com/ampproject/amphtml / getRotation

Function getRotation

build-system/common/update-session-issues/index.js:290–295  ·  view source on GitHub ↗

* @param {Array } timeRotationUtc * @param {Date} nextDay * @param {Date} start * @return {RotationItemDef}

(timeRotationUtc, nextDay, start)

Source from the content-addressed store, hash-verified

288 * @return {RotationItemDef}
289 */
290function getRotation(timeRotationUtc, nextDay, start) {
291 // @ts-ignore date calc
292 const delta = nextDay - start;
293 const weeks = Math.round(delta / (7 * 24 * 60 * 60 * 1000));
294 return timeRotationUtc[weeks % timeRotationUtc.length];
295}
296
297const timeZ = (yyyy, mm, dd, hours, minutes) =>
298 `${yyyy + mm + dd}T${leadingZero(hours) + leadingZero(minutes)}00Z`;

Callers 1

getNextIssueDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected