MoonTimestype
The Moon's rise, set and transits over a day. An event that does not happen that day is absent; alwaysUp or alwaysDown is set when the Moon stays above or below the horizon all day.
Import it
import type { MoonTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";
Definition
interface MoonTimes {
rise?: Date;
set?: Date;
transit?: Date;
lowerTransit?: Date;
alwaysUp?: boolean;
alwaysDown?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
rise (optional) | Date | undefined | |
set (optional) | Date | undefined | |
transit (optional) | Date | undefined | |
lowerTransit (optional) | Date | undefined | |
alwaysUp (optional) | boolean | undefined | |
alwaysDown (optional) | boolean | undefined |
Examples
import { getMoonTimes, type MoonTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";
const t: MoonTimes = getMoonTimes(new Date(Date.UTC(2026, 10, 7, 12)), 35.7, 139.7, 540);
console.log(t.rise instanceof Date || t.alwaysUp === true || t.alwaysDown === true || t.rise === undefined);trueWhat it prints (run when this page was built)