Difference between revisions of "Template:IGTracker"

From ShadowHaven Reloaded
Jump to navigation Jump to search
Line 1: Line 1:
<includeonly>{{#expr: {{#ifexpr: {{#time:d |now + 61 years}} >= {{{Day}}} | 1 | 0}} + {{#ifexpr: {{#time:m |now + 61 years}} >= {{{Month}}} | {{#time:m |now + 61 years}} - {{{Month}}} | 12- {{{Month}}} - {{#time:m |now + 61 years}} }} + {{#ifexpr: {{#time:Y |now + 61 years}} > {{{Year}}} | ({{#time:Y |now + 61 years}} - {{{Year}}})*12 | 0 }} + 1}}
<includeonly>{{#expr: {{#ifexpr: {{#time:d |now + 61 years}} >= {{{Day}}} | 1 | 0}} + {{#ifexpr: {{#time:m |now + 61 years}} >= {{{Month}}} | {{#time:m |now + 61 years}} - {{{Month}}} | 12- {{{Month}}} - {{#time:m |now + 61 years}} }} + {{#ifexpr: {{#time:Y |now + 61 years}} > {{{Year}}} | ({{#time:Y |now + 61 years}} - {{{Year}}})*12 | 0 }} }}
</includeonly>
</includeonly>
<noinclude>
<noinclude>

Revision as of 15:30, 10 December 2022


Usage

This template allows you to put in a character's date of birth, and it will automatically calculate their age based on the current in-game date. The following requirements apply:

  • All entries including Month must be in numeric format.
  • Year must be the full, 4 digit year.

So, if you enter this:

{{InfectedPowers|
|Month=9
|Day=29
|Year=2033
|}}

The template will return the current age of 25



The Month and Day field are both optional, if they are missing, the template will assume January and the 1st of the month. If you wish, you only need to enter a year.

If the year is not present, the template will return nothing.