Template:Year nav: Difference between revisions

From BoyWiki
No edit summary
No edit summary
Tag: Reverted
Line 1: Line 1:
{{short description|Calendar year|2=noreplace}}
{| class="infobox" style="text-align: center;"
{| class="infobox" style="text-align: center;"
| align="right" | <small>'''[[List of centuries|Centuries]]:''' </small>
! style="text-align:right;" | [[List of decades, centuries, and millennia|Millennium]]:  
| align="center" | <!--
| {{dr|y|m|{{{1|{{PAGENAME}}}}}|0|ys}}
--> [[{{ordinal|{{#expr: (({{{1|888}}} - 1) - (({{{1|888}}} - 1) mod 100))/100}}}} century]]<!--
--> - '''[[{{ordinal|{{#expr: (({{{1|888}}} - 1) - (({{{1|888}}} - 1) mod 100))/100 + 1}}}} century]]''' -<!--
--> [[{{ordinal|{{#expr: (({{{1|888}}} - 1) - (({{{1|888}}} - 1) mod 100))/100 + 2}}}} century]]
|-
|-
| align="right" | <small>'''[[List of decades|Decades]]:'''</small>
! style="text-align:right;" | [[List of decades, centuries, and millennia|Centuries]]:  
| align="center" | <small> <!--
| {{flatlist}}
--> [[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) - 30}}s]]&nbsp;<!--
{{dr|y|c|{{{1|{{PAGENAME}}}}}|-1|ys}}
--> [[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) - 20}}s]]&nbsp;<!--
* '''{{dr|y|c|{{{1|{{PAGENAME}}}}}|0|ys}} '''
--> [[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) - 10}}s]]&nbsp;<!--
* {{dr|y|c|{{{1|{{PAGENAME}}}}}|1|ys}}
--> - [[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10))}}s]] -<!--
{{endflatlist}}
--> &nbsp;[[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) + 10}}s]]<!--
--> &nbsp;[[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) + 20}}s]]<!--
--> &nbsp;[[{{#expr: ({{{1|888}}} - ({{{1|888}}} mod 10)) + 30}}s]]
</small>
|-
|-
| align="right" | <small>'''[[List of years|Years]]:'''</small>
! style="text-align:right;" | [[List of decades, centuries, and millennia|Decades]]:  
| align="center" | <!--
| {{flatlist}}
--> [[{{#expr: {{{1|888}}} - 3}}]]<!--
* {{dr|y|d|{{{1|{{PAGENAME}}}}}|-2|ys}}
--> [[{{#expr: {{{1|888}}} - 2}}]]<!--
* {{dr|y|d|{{{1|{{PAGENAME}}}}}|-1|ys}}
--> [[{{#expr: {{{1|888}}} - 1}}]]<!--
* '''{{dr|y|d|{{{1|{{PAGENAME}}}}}|0|ys}}'''
--> - '''[[{{{1|888}}}]]''' -<!--
* {{dr|y|d|{{{1|{{PAGENAME}}}}}|1|ys}}
--> [[{{#expr: {{{1|888}}} + 1}}]]<!--
* {{dr|y|d|{{{1|{{PAGENAME}}}}}|2|ys}}
--> [[{{#expr: {{{1|888}}} + 2}}]]<!--
{{endflatlist}}
--> [[{{#expr: {{{1|888}}} + 3}}]]
|-
! style="text-align:right;" | [[List of years|Years]]:
| {{flatlist}}
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|-3|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 12 |ysa|ys}}}}
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|-2|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 12 |ysa|ys}}}}
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|-1|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 12 |ysa|ys}}}}
* '''{{dr|y|y|{{{1|{{PAGENAME}}}}}|0|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 100 |ysa|ys}}}}'''
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|1|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 9 |ysa|ys}}}}
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|2|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 8 |ysa|ys}}}}
* {{dr|y|y|{{{1|{{PAGENAME}}}}}|3|{{#ifexpr: {{{1|{{PAGENAME}}}}} <= 7 |ysa|ys}}}}
{{endflatlist}}
|}<noinclude>
|}<noinclude>
[[Category:History and events navbox templates]]
[[Category:History and events navbox templates]]
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 13:42, 1 January 2023

[[Category:Script error: The module returned a nil value. It is supposed to return an export table. with short description]]

Millennium:
Centuries:
Decades:
  • '
Years:
  • '
BoyWiki Template documentation (for the above template, sometimes hidden or invisible)

Result

Output for default year "888" can be seen above.

Usage

Takes one parameter, the year-number (year 101 or higher).
The box width shrinks nearly 6% for smaller year-number sizes.

Example for "{{Year nav|1970}}" at right:
[[Category:Script error: The module returned a nil value. It is supposed to return an export table. with short description]]
Millennium: 2nd millennium
Centuries:
Decades:
Years:


Example for "{{Year nav|101}}" at right:
[[Category:Script error: The module returned a nil value. It is supposed to return an export table. with short description]]
Millennium: 1st millennium
Centuries:
Decades:
Years:


Example for "{{Year nav|100}}" [invalid] at right:
[[Category:Script error: The module returned a nil value. It is supposed to return an export table. with short description]]
Millennium: 1st millennium
Centuries:
Decades:
Years:
Use other tables to handle year 100 or below.

Notes

  • This template uses the #expr parser function to calculate centuries, decades, and year numbers surrounding the year parameter.
  • Negative numbers are passed through, not as "BC" but negative.
  • Variables are not used, as they were not a supported feature when this template was created, so calculations are made twice, as needed, to determine results.
Visit Template:Year nav/doc to edit this template's description!
Done making changes?   Refresh   Also see:  Portal:Template index  and   Help:Templates