Template:NHL Year: Difference between revisions
Appearance
Content deleted Content added
m 4 revisions from en:Template:NHL Year |
Mark Arsten (talk | changes) m Protected Template:NHL Year: Vandal target ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)) |
||
Line 1: | Line 1: | ||
{{#if: {{{nolink|}}} |
{{#if: {{{nolink|}}} |
||
| {{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#if: {{{full|}}}||{{#ifeq: {{{1}}}|1999|{{#if: {{{trunc|}}}|mod 100}}|mod 100}} }} }}|2}} | [[{{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#ifeq: {{{1}}}|1999||mod 100}}}}|2}} NHL season|{{#switch: {{{2}}} |
| {{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#if: {{{full|}}}||{{#ifeq: {{{1}}}|1999|{{#if: {{{trunc|}}}|mod 100}}|mod 100}} }} }}|2}}{{#if:{{{app|}}}| {{{app}}}}} | [[{{#if:{{{team|}}}|{{#ifexist:{{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#ifeq: {{{1}}}|1999||mod 100}}}}|2}} {{{team}}} season|{{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#ifeq: {{{1}}}|1999||mod 100}}}}|2}} {{{team}}} season|{{{team}}}}}|{{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#ifeq: {{{1}}}|1999||mod 100}}}}|2}} NHL season}}|{{#if:{{{title|}}}|{{{title}}}|{{#switch: {{{2}}} |
||
| start = {{{1|1000}}} |
| start = {{{1|1000}}} |
||
| end = {{#expr: {{{1|1000}}} + 1}} |
| end = {{#expr: {{{1|1000}}} + 1}} |
||
| {{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#if: {{{full|}}}||{{#ifeq: {{{1}}}|1999|{{#if: {{{trunc|}}}|mod 100}}|mod 100}} }} }}|2}} |
| {{{1|1000}}}–{{padleft:{{#expr: ({{{1|1000}}} + 1) {{#if: {{{full|}}}||{{#ifeq: {{{1}}}|1999|{{#if: {{{trunc|}}}|mod 100}}|mod 100}} }} }}|2}} |
||
}}]]}}<noinclude> |
}}{{#if:{{{app|}}}| {{{app}}}}}}}]]}}<noinclude> |
||
{{Documentation}} |
{{Documentation}} |
Revision as of 17:09, 27 December 2013
Usage
Use this template to link to "NHL season" articles from a particular year. The first parameter is the starting year of the season. By default, the template displays text in the form "yyyy–yy"; except for the 1999–2000 season, which is in the form "yyyy–yyyy" to comply with WP:YEAR: "A closing CE/AD year is normally written with two digits (1881–86) unless it is in a different century from that of the opening year (1881–1986)" (as of April 2009).
A second parameter may be used if only one year is to be displayed (does not work if nolink
is passed in).
{{nhly|...}}
is the other name of this template.
Named parameters
Passing in any non-empty text will produce the same result, so as a matter of style, only pass in "y" (without quotes).
- nolink
- Text must not be linked.
- full
- Text must be in "yyyy–yyyy" format.
- trunc
- The 1999–2000 season is to be displayed as "1999–00" instead of "1999–2000".
Examples
{{NHL Year|1999}}
→ 1999–2000{{NHL Year|1999|start}}
→ 1999{{NHL Year|1999|end}}
→ 2000{{NHL Year|1999|trunc=y}}
→ 1999–00{{NHL Year|1999|nolink=y|trunc=y}}
→ 1999–00
{{NHL Year|1998}}
→ 1998–99{{NHL Year|1998|full=y}}
→ 1998–1999{{NHL Year|1998|full=y|nolink=y}}
→ 1998–1999
Bad examples
- For style, only pass in "y" for the optional parameters:
{{NHL Year|1999|nolink=NO}}
→ 1999–2000 full
andtrunc
conflict:{{NHL Year|1999|full=y|trunc=y}}
→ 1999–2000start
/end
andnolink
are incompatible:{{NHL Year|1999|start|nolink=y}}
→ 1999–2000trunc
is useless for years other than 1999:{{NHL Year|1998|trunc=y}}
→ 1998–99full
is useless for 1999:{{NHL Year|1999|full=y}}
→ 1999–2000