Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Japanese calendar/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Through #invoke === * {{mlx|Japanese calendar|''function_name''|year{{=}}''year''|era{{=}}''article name or kanji''|previous{{=}}''yes''|next{{=}}''yes''}} The function name specifies how the data should be outputted. The <code>''year''</code> and <code>''era''</code> parameters determine what era and year the module outputs. The <code>''next''</code> and <code>''previous''</code> parameters tell the module to return data for the next or previous era, rather than the one specified. If a combination of parameters is invalid the module will usually output nothing. However, if both the <code>''next''</code> and <code>''previous''</code> parameters are specified it will output an error. ==== Year and era ==== The <code>''year''</code> parameter is the year in the [[Gregorian calendar]]. The <code>''era''</code> parameter can either be the article name for that era, or the era's name in [[kanji]]. (Transcribed English era names can usually be used, but will not work if they are ambiguous.) Either <code>''year''</code> or <code>''era''</code> must be specified. If both are specified, the module defaults to using <code>''era''</code> to get the era data. This enables output of the last year of the previous era (for example, Shōwa 64 is the same year as Heisei 1). {| class="wikitable" |- ! Code !! Output |- | <code><nowiki>{{#invoke:Japanese calendar|link|year=1950}}</nowiki></code> || {{#invoke:Japanese calendar|link|year=1950}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|era=Shōwa period}}</nowiki></code> || {{#invoke:Japanese calendar|link|era=Shōwa period}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|era=昭和}}</nowiki></code> || {{#invoke:Japanese calendar|link|era=昭和}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|era=Shōwa}}</nowiki></code> || {{#invoke:Japanese calendar|link|era=Shōwa}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1989}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1989}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1989|era=Shōwa period}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1989|era=Shōwa period}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1990}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1990}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1990|era=Shōwa period}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1990|era=Shōwa period}} |- |} ==== Functions ==== {| class="wikitable" |- ! Code !! Description !! Example |- | <code>baseyear</code> || The first year of the specified era. || <code><nowiki>{{#invoke:Japanese calendar|baseyear|era=Heisei}}</nowiki></code> → {{#invoke:Japanese calendar|baseyear|era=Heisei}} |- | <code>endyear</code> || The last year of the specified era. || <code><nowiki>{{#invoke:Japanese calendar|endyear|era=Shōwa period}}</nowiki></code> → {{#invoke:Japanese calendar|endyear|era=Shōwa period}} |- | <code>year</code> || The year for the specified era, without the era name. Defaults to the newer era, if more than one is applicable. || <code><nowiki>{{#invoke:Japanese calendar|year|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|year|year=1989}} |- | <code>kanjiyear</code> || The same as <code>''year''</code>, but in [[kanji]]. The first year of an era is changed to the kanji 元, and the others are changed to [[Halfwidth and fullwidth forms|full-width]] numbers. || <code><nowiki>{{#invoke:Japanese calendar|kanjiyear|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|kanjiyear|year=1989}} |- | <code>article</code> || The Wikipedia article for the era, unlinked. || <code><nowiki>{{#invoke:Japanese calendar|article|year=1950}}</nowiki></code> → {{#invoke:Japanese calendar|article|year=1950}} |- | <code>label</code> || The name of the era. Same as <code>''article''</code> for [[WP:DAB|undisambiguated]] titles. || <code><nowiki>{{#invoke:Japanese calendar|label|year=1950}}</nowiki></code> → {{#invoke:Japanese calendar|label|year=1950}} |- | <code>link</code> || A link to the Wikipedia article of the specified era. || <code><nowiki>{{#invoke:Japanese calendar|link|year=1950}}</nowiki></code> → {{#invoke:Japanese calendar|link|year=1950}} |- | <code>kanji</code> || The kanji for the specified era. || <code><nowiki>{{#invoke:Japanese calendar|kanji|year=1950}}</nowiki></code> → {{#invoke:Japanese calendar|kanji|year=1950}} |- | <code>label_year</code> || <code>''label''</code> followed by <code>''year''</code> || <code><nowiki>{{#invoke:Japanese calendar|label_year|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|label_year|year=1989}} |- | <code>link_year</code> || <code>''link''</code> followed by <code>''year''</code> || <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|link_year|year=1989}} |- | <code>label_kanjiyear</code> || <code>''label''</code> followed by <code>''kanjiyear''</code> || <code><nowiki>{{#invoke:Japanese calendar|label_kanjiyear|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|label_kanjiyear|year=1989}} |- | <code>link_kanjiyear</code> || <code>''link''</code> followed by <code>''kanjiyear''</code> || <code><nowiki>{{#invoke:Japanese calendar|link_kanjiyear|year=1989}}</nowiki></code> → {{#invoke:Japanese calendar|link_kanjiyear|year=1989}} |- |} ==== Next, previous and old ==== If the <code>''next''</code> parameter is specified, the module outputs the data for the subsequent era; if the <code>''previous''</code> parameter is specified it outputs the data for the previous one. If the <code>''old''</code> parameter is specified, the module outputs the data for the "old" era. This is the same as the current era unless the year is set to the first year of the specified era. If this is the case, then <code>''old''</code> outputs the data for the previous era. However, if the module could not find a valid previous era then the data for the current era is returned. {| class="wikitable" |- ! Code !! Output |- | <code><nowiki>{{#invoke:Japanese calendar|baseyear|era=Shōwa period}}</nowiki></code> || {{#invoke:Japanese calendar|baseyear|era=Shōwa period}} |- | <code><nowiki>{{#invoke:Japanese calendar|baseyear|era=Shōwa period|next=yes}}</nowiki></code> || {{#invoke:Japanese calendar|baseyear|era=Shōwa period|next=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|baseyear|era=Shōwa period|previous=yes}}</nowiki></code> || {{#invoke:Japanese calendar|baseyear|era=Shōwa period|previous=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|baseyear|era=Shōwa period|old=yes}}</nowiki></code> || {{#invoke:Japanese calendar|baseyear|era=Shōwa period|old=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|year=1880}}</nowiki></code> || {{#invoke:Japanese calendar|link|year=1880}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|year=1880|next=yes}}</nowiki></code> || {{#invoke:Japanese calendar|link|year=1880|next=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|year=1880|previous=yes}}</nowiki></code> || {{#invoke:Japanese calendar|link|year=1880|previous=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|link|year=1880|old=yes}}</nowiki></code> || {{#invoke:Japanese calendar|link|year=1880|old=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1926}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1926}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1926|old=yes}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1926|old=yes}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1927}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1927}} |- | <code><nowiki>{{#invoke:Japanese calendar|link_year|year=1927|old=yes}}</nowiki></code> || {{#invoke:Japanese calendar|link_year|year=1927|old=yes}} |- |}
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)