Skip to the content

Hikidashi引き出し

Era dates (和暦) and kanji numerals both ways, the dictionary forms of a conjugated word, a reading shared out over its kanji, words pulled from pasted text, and how hard a sentence is to read.

Hikidashi (引き出し) is a drawer: each tool is pulled out when it is wanted. About the name

Contents

Reference · Era years

JapaneseEratype

An era, as it is written, said and counted: one row of JAPANESE_ERAS.

Import it

import type { JapaneseEra } from "@johnmorrisdotca/hikidashi/wareki";

Also exported from: @johnmorrisdotca/hikidashi

Definition

type JapaneseEra = {
    kanji: string;
    romaji: string;
    reading: string;
    startYear: number;
    lastYear: number | null;
    startDate: string;
    endDate: string | null;
    spellings: readonly string[];
};

Members

NameTypeDescription
kanjistring

The name in kanji, which is how a date is written.

romajistring

The Latin name, capitalised as English writes it.

readingstring

The reading in hiragana, for anyone meeting the kanji for the first time.

startYearnumber

The Western year the era's first year falls in.

lastYearnumber | null

The highest year the era reached, or null while it is still running.

昭和 ran to 64 and 平成 to 31, so 昭和65 is not a date and answering with 1990 would be a wrong answer rather than a missing one.

startDatestring

The era's first day, as YYYY-MM-DD: the day the emperor's reign, or for 明治 the name itself, began.

endDatestring | null

The era's last day, as YYYY-MM-DD: the day before the next era began. Null while it is still running.

spellingsreadonly string[]

Every spelling the name is written with in Latin letters, in lower case.

The long vowels are the reason there is a list rather than one string: 昭和 is Showa, Shouwa and Shōwa depending on whose romanization somebody learned, and all three are the same era.

Examples

import { JAPANESE_ERAS, type JapaneseEra } from "@johnmorrisdotca/hikidashi/wareki";

const heisei: JapaneseEra = JAPANESE_ERAS[3]!;
console.log(heisei.kanji, heisei.romaji, heisei.reading, heisei.startDate, heisei.endDate, heisei.lastYear);
平成 Heisei へいせい 1989-01-08 2019-04-30 31

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hikidashi 1.1.0.