Jump to content

Module:Japanese calendar/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 11:34, 22 August 2013 (make a start). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)


This module is used to calculate dates in the Japanese calendar. It defines an "era" class which is designed to be called from other Lua modules, and it also contains several functions to export Japanese calendar data directly to Wikipedia pages through #invoke.

Usage

Through #invoke

{{#invoke:Japanese calendar|function_name|year=year|article=article|kanji=kanji}}

The function name specifies how the data should be outputted. The year, article, and kanji parameters determine what era and year the module outputs.

Functions
Code Description Example
baseyear The first year of the specified era. {{#invoke:Japanese calendar|baseyear|article=Heisei}}
year The year for the specified era, without the era name. {{#invoke:Japanese calendar|year|year=1989}} → 1
kanjiyear The same as year, but in kanji. Only affects the first year of an era. {{#invoke:Japanese calendar|kanjiyear|year=1989}} → 元
article The Wikipedia article for the era, unlinked. {{#invoke:Japanese calendar|article|year=1950}} → Shōwa (1926–1989)
label The name of the era. Same as article for undisambiguated titles. {{#invoke:Japanese calendar|label|year=1950}} → Shōwa
link A link to the Wikipedia article of the specified era. {{#invoke:Japanese calendar|link|year=1950}}Shōwa
kanji The kanji for the specified era. {{#invoke:Japanese calendar|kanji|year=1950}} → 昭和
label_year label followed by year {{#invoke:Japanese calendar|label_year|year=1989}} → Heisei 1
link_year link followed by year {{#invoke:Japanese calendar|link_year|year=1989}}Heisei 1
label_kanjiyear label followed by kanjiyear {{#invoke:Japanese calendar|label_kanjiyear|year=1989}} → Heisei 元
link_kanjiyear link followed by kanjiyear {{#invoke:Japanese calendar|link_kanjiyear|year=1989}}Heisei