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

eraYearsOffunction

Every era year that falls in a Western year, the newest era first.

Most years have one answer. The years an era changed in have two: 1912 is 大正1 and 明治45, 1926 is 昭和1 and 大正15, 1989 is 平成1 and 昭和64, 2019 is 令和1 and 平成31. 1868 is 明治1 alone.

Import it

import { eraYearsOf } from "@johnmorrisdotca/hikidashi/wareki";

Also exported from: @johnmorrisdotca/hikidashi

Definition

function eraYearsOf(westernYear: number): EraYear[]

Parameters

NameTypeDescription
westernYearnumber

A Western year, such as 1989.

Returns

EraYear[]

One era year, or two in a year an era changed in, newest first; an empty list for a year before 1868, a year past the reach of the era still running, or a number that is not a whole year.

Examples

import { eraYearsOf } from "@johnmorrisdotca/hikidashi/wareki";

console.log(eraYearsOf(1989).map((one) => `${one.era.kanji}${one.year}`));
console.log(eraYearsOf(2000).map((one) => `${one.era.kanji}${one.year}`), eraYearsOf(1850));
[ '平成1', '昭和64' ]
[ '平成12' ] []

What it prints (run when this page was built)

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