Module:Japanese calendar/doc
Appearance
![]() | This is a documentation subpage for Module:Japanese calendar. It may contain usage information, categories and other content that is not part of the original module page. |
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 元
|