Template:Year: Difference between revisions

From Absit Omen Lexicon
mNo edit summary
mNo edit summary
Line 1: Line 1:
<includeonly>{{#switch: {{#ifexpr: {{CurrentDate|month}}<7|{{#ifexpr: {{{2}}} <= 8 | {{#expr:{{CurrentDate|year}}-({{{1}}}+11)+1}} | {{#expr:{{CurrentDate|year}}-({{{1}}}+12)}} }}|{{#ifexpr: {{{2}}} <= 8 | {{#expr:{{CurrentDate|year}}-({{{1}}}+11)+1}} | {{#expr:{{CurrentDate|year}}-({{{1}}}+12)+1}} }}}}
<includeonly>{{#switch: {{Year/calc|{{{1}}}|{{{2}}}}}
| 1= {{#ifeq: {{{4|}}} | cat | [[Category:First Year|1]][[Category: {{House|{{{3}}}}} First Year{{!}}{{{3}}}1]]|First Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 1= {{#ifeq: {{{4|}}} | cat | [[Category:First Year|1]][[Category: {{House|{{{3}}}}} First Year{{!}}{{{3}}}1]]|First Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 2= {{#ifeq: {{{4|}}} | cat | [[Category:Second Year|2]][[Category: {{House|{{{3}}}}} Second Year{{!}}{{{3}}}2]]|Second Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 2= {{#ifeq: {{{4|}}} | cat | [[Category:Second Year|2]][[Category: {{House|{{{3}}}}} Second Year{{!}}{{{3}}}2]]|Second Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
Line 7: Line 7:
| 6= {{#ifeq: {{{4|}}} | cat | [[Category:Sixth Year|6]][[Category: {{House|{{{3}}}}} Sixth Year{{!}}{{{3}}}6]]|Sixth Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 6= {{#ifeq: {{{4|}}} | cat | [[Category:Sixth Year|6]][[Category: {{House|{{{3}}}}} Sixth Year{{!}}{{{3}}}6]]|Sixth Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 7= {{#ifeq: {{{4|}}} | cat | [[Category:Seventh Year|7]][[Category: {{House|{{{3}}}}} Seventh Year{{!}}{{{3}}}7]]|Seventh Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 7= {{#ifeq: {{{4|}}} | cat | [[Category:Seventh Year|7]][[Category: {{House|{{{3}}}}} Seventh Year{{!}}{{{3}}}7]]|Seventh Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| {{#expr:>=7}}=  {{#ifeq: {{{4|}}} | cat | [[Category:Class of {{Year/grad|{{{1}}}|{{{2}}}}}|{{Year/grad|{{{1}}}|{{{2}}}}}]][[Category: {{House|{{{3}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}}{{!}}{{{3}}}{{Year/grad|{{{1}}}|{{{2}}}}}]]|{{#if: {{{3|}}}|{{House|{{{3}}}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}} }} }}</includeonly><noinclude>
|   {{#ifeq: {{{4|}}} | cat | [[Category:Class of {{Year/grad|{{{1}}}|{{{2}}}}}|{{Year/grad|{{{1}}}|{{{2}}}}}]][[Category: {{House|{{{3}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}}{{!}}{{{3}}}{{Year/grad|{{{1}}}|{{{2}}}}}]]|{{#if: {{{3|}}}|{{House|{{{3}}}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}} }} }}</includeonly><noinclude>
{{Year/doc}}
{{Year/doc}}


[[Category:Templates]]</noinclude>
[[Category:Templates]]</noinclude>

Revision as of 20:40, 15 October 2012


This template returns the current year of a student, or the year a non-student character graduated. It uses the Current Date Module to determine the current date. Enter the Birth year as the first value and the birth month as the second value.

Syntax
{{Year|birthYear|birthmonth}}
The Year template can also take a Hogwarts House specifier. g=Gryffindor, r=Ravenclaw, h=Hufflepuff, s=Slytherin. Also d=Durmstrang Institute, b=Beauxbatons Academy, w=Salem Witches Institute
{{Year|birthYear|birthmonth|firstletterofhouse}}
Example
{{Year|2006|8|g}} returns "Gryffindor Class of Template:Year/grad"
{{Year|1997|8|g}} returns "Gryffindor Class of Template:Year/grad"
{{Year|1998|3}} returns "Class of Template:Year/grad"
{{Year|1994|9}} returns "Class of Template:Year/grad"
{{Year|1990|06}} returns "Class of Template:Year/grad"
{{Year|1981|7|r}} returns "Ravenclaw Class of Template:Year/grad"
{{Year|1960|11}} returns "Class of Template:Year/grad"

The year template invokes Module:Year. It also makes use of Module:Date and Module:CurrentDate to set the date by which the year is calculated.