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

formatEraYearJapanesefunction

The era year as it is written in Japanese: 平成3年. With gannen, the first year is written the way forms write it: 令和元年.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

function formatEraYearJapanese(found: EraYear, options?: { gannen?: boolean; }): string

Parameters

NameTypeDescription
foundEraYear

An era year, from parseEraYear, eraYearOf, eraYearsOf or eraOnDate.

options (optional){ gannen?: boolean; }

gannen: true writes a first year as 元年 rather than 1年.

Returns

string

The era's kanji, the year and 年, such as 令和6年.

Examples

import { eraYearOf, formatEraYearJapanese } from "@johnmorrisdotca/hikidashi/wareki";

const first = eraYearOf(2019)!;
console.log(formatEraYearJapanese(first), formatEraYearJapanese(first, { gannen: true }));
令和1年 令和元年

What it prints (run when this page was built)

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