Skip to the content

Koyomi Calendars暦

Calendar pages as SVG: a day as an icon in 18 original designs, a whole month as a poster or a desk pad, and the page turning from one day to the next.

Koyomi is the Japanese word 暦 for the calendar. About the name

Contents

Reference

/japanese

import { … } from "@johnmorrisdotca/koyomi-calendars/japanese";

The Japanese calendar facts a date page can show, computed and never looked up: the public holidays (国民の祝日, kokumin no shukujitsu), the old calendar date (旧暦, kyūreki, the lunisolar calendar of the Tenpō era's rules) and the six-day cycle (六曜, rokuyō). Pure functions of the date: no clock, no network, no table. A date the method cannot settle gives null, never a guess.

Holidays: the Act on National Holidays (国民の祝日に関する法律, Act No. 178 of 1948) as amended through the Happy Monday changes of 2000 and 2003, the Greenery and Showa Day change of 2007, Mountain Day (2016), the imperial succession of 2019, the Olympic moves of 2020 and 2021 and Sports Day (2020), for the years 2000 to 2099. Equinox days (春分の日, 秋分の日) use the formula the National Astronomical Observatory of Japan (国立天文台) publishes for 1980 to 2099; the Observatory announces each year's day in February of the year before, so a far year is its prediction. Substitute holidays (振替休日, the next day that is not a holiday, since 2007; the Monday, before) and Citizens' Holidays (国民の休日, a day between two holidays) are derived by the Act's own rules. The law in force in November 2026 is assumed for later years; an amendment changes this file, not a stored list.

Old calendar: the month starts on the Japan Standard Time (UTC+9) date of the new moon; the month that holds the winter solstice is the 11th; each other month is numbered by the principal term (中気, chūki: solar longitude 0°, 30°, ... 330°) it holds, and the first month with none in a year of thirteen months is the leap month (閏月, uruu-zuki) with the number of the month before it. The new moon is Meeus's (Astronomical Algorithms, 2nd ed., 1998, chapter 49) and the sun's apparent longitude his chapter 25 (about 0.01°, ten to fifteen minutes): a new moon or a principal term within 30 minutes of midnight in Japan makes the date null. Years 1900 to 2100.

Rokuyō: 先勝, 友引, 先負, 仏滅, 大安, 赤口 by (old month + old day) mod 6 (the month number of a leap month is that of the month before it).

Exports

NameKindWhat it is
JAPANESE_HOLIDAY_YEARSconstantThe first and last year the holiday rules describe.
japaneseHolidayfunctionThe public holiday of a day, in both languages.
JapaneseHolidaytypeA Japanese public holiday's name, in Japanese and in English.
japaneseHolidaysOffunctionEvery public holiday of a year, computed from the law's rules.
OLD_CALENDAR_YEARSconstantThe first and last year the old-calendar astronomy is held to.
oldCalendarDatefunctionThe old-calendar date of a Gregorian date, from the new moons and the sun's longitude.
OldDatetypeA date of the old Japanese calendar (旧暦, kyūreki): a month 1 to 12, a day, and whether the month is a leap month.
RokuyotypeOne day of the six-day cycle (六曜, rokuyō): its name, its reading and an English gloss.
ROKUYOconstantThe six days in order of (old month + old day) mod 6, with the reading and an English gloss.
rokuyoOffunctionThe day of the six-day cycle (六曜, rokuyō) of a Gregorian date.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/koyomi-calendars 0.3.0.