Template:AgeFull: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (ah, using relative paths causes the transcluding page to look for those pages relative to itself)
(okay, something is messed up; even with added link to serial date template, this date breaks the template)
Line 1: Line 1:
{{#if:{{{year|}}}
<includeonly>{{#if:{{{year|}}}
  |{{#if:{{{month|}}}
  |{{#if:{{{month|}}}
   |{{#if:{{{day|}}}
   |{{#if:{{{day|}}}
Line 26: Line 26:
     |{{#expr:{{CURRENTDAY}}-{{{day}}}
     |{{#expr:{{CURRENTDAY}}-{{{day}}}
       }}
       }}
     |{{#expr:{{Gregorian serial date
     |{{#expr:{{Gsd
       |year={{CURRENTYEAR}}
       |year={{CURRENTYEAR}}
       |month={{CURRENTMONTH}}
       |month={{CURRENTMONTH}}
       |day={{CURRENTDAY}}}}-{{Gregorian serial date
       |day={{CURRENTDAY}}}}-{{Gsd
       |year={{CURRENTYEAR}}
       |year={{CURRENTYEAR}}
       |month={{#expr:{{CURRENTMONTH}}-1}}
       |month={{#expr:{{CURRENTMONTH}}-1}}
Line 69: Line 69:
   }}
   }}
  |some time
  |some time
}}
}}</includeonly>
<noinclude>Copied from Wikipedia's [[wikipedia:Template:For year month day|For year month day]] template. The three parameters are "year", "month", and "day", all optional. Here's what happens if you supply a specific date:
 
<nowiki>{{AgeFull|year=2001|month=1|day=27}}</nowiki>
yields<br />
{{AgeFull|year=2001|month=1|day=27}}
</noinclude>

Revision as of 18:51, 13 June 2013

Copied from Wikipedia's For year month day template. The three parameters are "year", "month", and "day", all optional. Here's what happens if you supply a specific date:

{{AgeFull|year=2001|month=1|day=27}} yields
23 years, 3 months, and 16 days