* @param {Array } timeRotationUtc * @param {Date} nextDay * @param {Date} start * @return {RotationItemDef}
(timeRotationUtc, nextDay, start)
| 288 | * @return {RotationItemDef} |
| 289 | */ |
| 290 | function 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 | |
| 297 | const timeZ = (yyyy, mm, dd, hours, minutes) => |
| 298 | `${yyyy + mm + dd}T${leadingZero(hours) + leadingZero(minutes)}00Z`; |