oldCalendarDatefunction
The old-calendar date of a Gregorian date, from the new moons and the sun's longitude.
Import it
import { oldCalendarDate } from "@johnmorrisdotca/koyomi-calendars/japanese";
Also exported from: @johnmorrisdotca/koyomi-calendars
Definition
function oldCalendarDate(year: number, month: number, dayOfMonth: number): OldDate | null
Parameters
| Name | Type | Description |
|---|---|---|
year | number | Four-digit year. |
month | number | Month 1 to 12. |
dayOfMonth | number | Day of the month. |
Returns
OldDate | null
The old month, day and whether the month is a leap month, or null when the date is outside 1900 to 2100 or a new moon or principal term falls too near midnight in Japan to be sure.
Examples
import { oldCalendarDate } from "@johnmorrisdotca/koyomi-calendars/japanese";
console.log(oldCalendarDate(2026, 11, 3));{ month: 9, day: 24, leap: false }What it prints (run when this page was built)