mirror of
https://github.com/acamarata/moon-cycle.git
synced 2026-06-30 18:54:29 +00:00
899 B
899 B
moon-cycle / cycleYear
Function: cycleYear()
cycleYear(
date?):string
Defined in: cycleYear.ts:17
Maps a date to the corresponding NASA moon image for the yearly cycle.
The yearly dataset contains 8,760 hourly images covering the full calendar year 2023 (365 days × 24 hours). This function computes the fractional position within a 365-day year relative to 2023-01-01 and maps that fraction to an image index in [1, 8760].
The cycle repeats annually, so dates in any year resolve to the equivalent hour-of-year position in the 2023 imagery.
Parameters
date?
Date = ...
The date to resolve. Defaults to the current time.
Returns
string
A zero-padded filename string, e.g. "4380.webp".