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
| Name | Type | Description |
|---|---|---|
found | EraYear | An era year, from |
options (optional) | { gannen?: boolean; } |
|
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)