Template:KzCYear: Difference between revisions

From FeyworldWiki
Jump to navigationJump to search
(Created page with "<noinclude> Use the following to cut and paste to an entry for a year in the dwarven Kazmarron Calendar. <pre><nowiki> {{KvCYear|<year>}} </nowiki></pre> '''Usage:''' Enter a positive integer for a year of the current Age (Dagsbrún) - e.g. <code><nowiki>{{KzCYear|110}}</nowiki></code> renders as "the 110th Year of Dagsbrún". Enter a negative integer to count backward from the start of Dagsbrún (NC 2000, with no year 0); the template walks the Kazmarron Calendar#...")
 
No edit summary
 
Line 2: Line 2:
Use the following to cut and paste to an entry for a year in the dwarven [[Kazmarron Calendar]].
Use the following to cut and paste to an entry for a year in the dwarven [[Kazmarron Calendar]].
<pre><nowiki>
<pre><nowiki>
{{KvCYear|<year>}}
{{KzCYear|<year>}}
</nowiki></pre>
</nowiki></pre>
'''Usage:''' Enter a positive integer for a year of the current Age (Dagsbrún) - e.g. <code><nowiki>{{KzCYear|110}}</nowiki></code> renders as "the 110th Year of Dagsbrún". Enter a negative integer to count backward from the start of Dagsbrún (NC 2000, with no year 0); the template walks the [[Kazmarron Calendar#Dwarven Roll of Years|Dwarven Roll of Years]] to find the correct Age and year automatically - e.g. <code><nowiki>{{KzCYear|-1}}</nowiki></code> renders as "the 403rd Year of Lêstenacht". Years before the start of Blómstrandi (NC -1399, the Peace of Gundagor) fall outside the Roll of Years and render as "N years before the Peace of Gundagor" instead.
'''Usage:''' Enter a positive integer for a year of the current Age (Dagsbrún) - e.g. <code><nowiki>{{KzCYear|110}}</nowiki></code> renders as "the 110th Year of Dagsbrún". Enter a negative integer to count backward from the start of Dagsbrún (NC 2000, with no year 0); the template walks the [[Kazmarron Calendar#Dwarven Roll of Years|Dwarven Roll of Years]] to find the correct Age and year automatically - e.g. <code><nowiki>{{KzCYear|-1}}</nowiki></code> renders as "the 403rd Year of Lêstenacht". Years before the start of Blómstrandi (NC -1399, the Peace of Gundagor) fall outside the Roll of Years and render as "N years before the Peace of Gundagor" instead.
[[Category:Templates]]
[[Category:Templates]]
</noinclude><includeonly>{{#ifexpr:{{{1}}}>0|{{#vardefine:ncyear|{{#expr:1999+{{{1}}}}}}}{{#vardefine:age|Dagsbrún}}{{#vardefine:ageyear|{{{1}}}}}|{{#vardefine:ncyear|{{#expr:2000+{{{1}}}}}}}{{#ifexpr:{{#var:ncyear}}>=1597|{{#vardefine:age|Lêstenacht}}{{#vardefine:agestart|1597}}|{{#ifexpr:{{#var:ncyear}}>=979|{{#vardefine:age|Áskorunglóð}}{{#vardefine:agestart|979}}|{{#ifexpr:{{#var:ncyear}}>=203|{{#vardefine:age|Tímum Sannleikans}}{{#vardefine:agestart|203}}|{{#ifexpr:{{#var:ncyear}}>=-776|{{#vardefine:age|Skuggaflóð}}{{#vardefine:agestart|-776}}|{{#ifexpr:{{#var:ncyear}}>=-1399|{{#vardefine:age|Blómstrandi}}{{#vardefine:agestart|-1399}}|{{#vardefine:age|unknown}}{{#vardefine:beforeyears|{{#expr:-1399-{{#var:ncyear}}}}}}}}}}}}}}{{#ifeq:{{#var:age}}|unknown|{{#vardefine:ageyear|0}}|{{#vardefine:ageyear|{{#expr:{{#var:ncyear}}-{{#var:agestart}}+1}}}}}}}}{{#ifexpr:{{#var:ncyear}}>0|{{#vardefine:ylink|{{#var:ncyear}}}}|{{#vardefine:ylink|{{abs|{{#var:ncyear}}}} BF}}}}{{#ifexpr:({{#var:ageyear}} mod 100=11) or ({{#var:ageyear}} mod 100=12) or ({{#var:ageyear}} mod 100=13)|{{#vardefine:suffix|th}}|{{#ifexpr:{{#var:ageyear}} mod 10=1|{{#vardefine:suffix|st}}|{{#ifexpr:{{#var:ageyear}} mod 10=2|{{#vardefine:suffix|nd}}|{{#ifexpr:{{#var:ageyear}} mod 10=3|{{#vardefine:suffix|rd}}|{{#vardefine:suffix|th}}}}}}}}}}{{#ifeq:{{#var:age}}|unknown|[[{{#var:ylink}}|{{#ifexpr:{{#var:beforeyears}}=1|1 year before the Peace of Gundagor|{{#var:beforeyears}} years before the Peace of Gundagor}}]]|[[{{#var:ylink}}|the {{#var:ageyear}}{{#var:suffix}} Year of {{#var:age}}]]}}</includeonly>
</noinclude><includeonly>{{#ifexpr:{{{1}}}>0|{{#vardefine:ncyear|{{#expr:1999+{{{1}}}}}}}{{#vardefine:age|Dagsbrún}}{{#vardefine:ageyear|{{{1}}}}}|{{#vardefine:ncyear|{{#expr:2000+{{{1}}}}}}}{{#ifexpr:{{#var:ncyear}}>=1597|{{#vardefine:age|Lêstenacht}}{{#vardefine:agestart|1597}}|{{#ifexpr:{{#var:ncyear}}>=979|{{#vardefine:age|Áskorunglóð}}{{#vardefine:agestart|979}}|{{#ifexpr:{{#var:ncyear}}>=203|{{#vardefine:age|Tímum Sannleikans}}{{#vardefine:agestart|203}}|{{#ifexpr:{{#var:ncyear}}>=-776|{{#vardefine:age|Skuggaflóð}}{{#vardefine:agestart|-776}}|{{#ifexpr:{{#var:ncyear}}>=-1399|{{#vardefine:age|Blómstrandi}}{{#vardefine:agestart|-1399}}|{{#vardefine:age|unknown}}{{#vardefine:beforeyears|{{#expr:-1399-{{#var:ncyear}}}}}}}}}}}}}}{{#ifeq:{{#var:age}}|unknown|{{#vardefine:ageyear|0}}|{{#vardefine:ageyear|{{#expr:{{#var:ncyear}}-{{#var:agestart}}+1}}}}}}}}{{#ifexpr:{{#var:ncyear}}>0|{{#vardefine:ylink|{{#var:ncyear}}}}|{{#vardefine:ylink|{{abs|{{#var:ncyear}}}} BF}}}}{{#ifexpr:({{#var:ageyear}} mod 100=11) or ({{#var:ageyear}} mod 100=12) or ({{#var:ageyear}} mod 100=13)|{{#vardefine:suffix|th}}|{{#ifexpr:{{#var:ageyear}} mod 10=1|{{#vardefine:suffix|st}}|{{#ifexpr:{{#var:ageyear}} mod 10=2|{{#vardefine:suffix|nd}}|{{#ifexpr:{{#var:ageyear}} mod 10=3|{{#vardefine:suffix|rd}}|{{#vardefine:suffix|th}}}}}}}}}}{{#ifeq:{{#var:age}}|unknown|[[{{#var:ylink}}|{{#ifexpr:{{#var:beforeyears}}=1|1 year before the Peace of Gundagor|{{#var:beforeyears}} years before the Peace of Gundagor}}]]|[[{{#var:ylink}}|the {{#var:ageyear}}{{#var:suffix}} Year of {{#var:age}}]]}}</includeonly>

Latest revision as of 11:22, 4 September 2026

Use the following to cut and paste to an entry for a year in the dwarven Kazmarron Calendar.

{{KzCYear|<year>}}

Usage: Enter a positive integer for a year of the current Age (Dagsbrún) - e.g. {{KzCYear|110}} renders as "the 110th Year of Dagsbrún". Enter a negative integer to count backward from the start of Dagsbrún (NC 2000, with no year 0); the template walks the Dwarven Roll of Years to find the correct Age and year automatically - e.g. {{KzCYear|-1}} renders as "the 403rd Year of Lêstenacht". Years before the start of Blómstrandi (NC -1399, the Peace of Gundagor) fall outside the Roll of Years and render as "N years before the Peace of Gundagor" instead.