Module:British regnal year/doc: Difference between revisions

Content deleted Content added
expand
 
(2 intermediate revisions by one other user not shown)
Line 1:
{{module rating|protectedbeta}}
 
This module implements the {{tl|British regnal year}} template. It converts a year in the Gregorian calendar into a British [[regnal year]].
Line 9:
<nowiki>{{</nowiki><code>British regnal year|1952</code><nowiki>}}</nowiki> → {{British regnal year|1952}}
 
=== How it worksData ===
 
The data for the module is stored in a table at [[Module:British regnal year/data]]. The module looks through the data list from newest to oldest, and returns the data for the first result where the input year is greater than or equal to the <code>year</code> value. ItThe calculatesdata thetable regnalentries yearare basedorganised onas the input year, the value of <code>year</code>, and the value of <code>startYear</code>. For most years it calculates the previous regnal year by subtracting one from the input year, but if the input year is equal to the value of <code>year</code>, the module uses the <code>prevEndYear</code> value and gets the link from <code>linkPrev</code> instead. A note can be added at the end of any entry by using the <code>note</code> field.follows:
 
=== Data fields ===
 
The data table entries are organised as follows:
* <code>year</code> - the year that the template searches for when deciding what links to display. In most cases this is the year that the monarch's reign began, although it can be different if the history is complicated.
* <code>linkCurrent</code> - a wikilink to the current monarch's Wikipedia article.
Line 26 ⟶ 22:
 
* {{tl|year in other calendars}}
<noinclude>
[[Category:Module documentation pages]]
</noinclude>