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

EraYeartype

An era year that parsed or was found, and the Western year it names: what parseEraYear, eraYearOf, eraYearsOf and eraOnDate give.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

type EraYear = {
    era: JapaneseEra;
    year: number;
    westernYear: number;
};

Members

NameTypeDescription
eraJapaneseEra
yearnumber

The year within the era, counting from one.

westernYearnumber

The Western year it falls in.

Examples

import { parseEraYear, type EraYear } from "@johnmorrisdotca/hikidashi/wareki";

const found: EraYear | null = parseEraYear("平成3年");
if (found !== null) console.log(found.era.kanji, found.year, found.westernYear);
平成 3 1991

What it prints (run when this page was built)

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