リファレンス · 場所から見た太陽と月: 位置、日の出と日の入り、月の出入りと月相。suncalc 2 と同じ名前で、より正確です
SunTimes型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The Sun's times for a day: each a Date or null when the Sun does not reach that height that day, solarNoon and nadir always there, and alwaysUp or alwaysDown when the Sun stays above or below the sunrise height all day.
インポート
import type { SunTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";
定義
type SunTimes = Record<SunTimeName, Date | null> & {
solarNoon: Date;
nadir: Date;
alwaysUp?: boolean;
alwaysDown?: boolean;
[custom: string]: Date | boolean | null | undefined;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
sunrise | Date | null | |
sunset | Date | null | |
sunriseEnd | Date | null | |
sunsetStart | Date | null | |
dawn | Date | null | |
dusk | Date | null | |
nauticalDawn | Date | null | |
nauticalDusk | Date | null | |
nightEnd | Date | null | |
night | Date | null | |
goldenHourEnd | Date | null | |
goldenHour | Date | null | |
solarNoon | Date | |
nadir | Date | |
alwaysUp (省略可) | boolean | undefined | |
alwaysDown (省略可) | boolean | undefined |
例
import { getTimes, type SunTimes } from "@johnmorrisdotca/wakusei-planets/suncalc";
const t: SunTimes = getTimes(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
console.log(t.sunrise instanceof Date, t.solarNoon instanceof Date);true true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。