Difference between revisions of "Template:Age in weeks and days"

From blackwiki
Jump to navigation Jump to search
blackwiki>Cydebot
m (Robot - Removing category Templates using ParserFunctions per CFD at Wikipedia:Categories for discussion/Log/2008 August 21.)
blackwiki>Waldyrious
(added whitespace to make the code readable)
Line 1: Line 1:
<includeonly>{{plural|{{Age in weeks|month1={{{month1|{{CURRENTMONTH}}}}}|day1={{{day1|{{CURRENTDAY}}}}}|year1={{{year1|{{CURRENTYEAR}}}}}|     month2={{{month2|{{CURRENTMONTH}}}}}|day2={{{day2|{{CURRENTDAY}}}}}|year2={{{year2|{{CURRENTYEAR}}}}}}}|week}} and {{plural|{{mod|{{#expr:({{gsd|year={{{year2|{{CURRENTYEAR}}}}}|month={{{month2|{{CURRENTMONTH}}}}}|day={{{day2|{{CURRENTDAY}}}}}}}-{{gsd|year={{{year1|{{CURRENTYEAR}}}}}|month={{{month1|{{CURRENTMONTH}}}}}|day={{{day1|{{CURRENTDAY}}}}}}})}}|7}}|day}}</includeonly><noinclude>This template returns the number of weeks and days that have elapsed between two dates. If the second set of parameters is not included it will automatically calculate the period between a given date and today.
+
<includeonly>{{plural
 +
  |{{Age in weeks
 +
    |month1 = {{{month1 | {{CURRENTMONTH}} }}}
 +
    |day1   = {{{day1   | {{CURRENTDAY}}   }}}
 +
    |year1 = {{{year1 | {{CURRENTYEAR}} }}}
 +
    |month2 = {{{month2 | {{CURRENTMONTH}} }}}
 +
    |day2   = {{{day2   | {{CURRENTDAY}}   }}}
 +
    |year2 = {{{year2 | {{CURRENTYEAR}} }}}
 +
  }}|
 +
  week}}
 +
and
 +
{{plural
 +
  |{{mod
 +
    |{{#expr:
 +
      ({{gsd <!-- Gregorian serial date -->
 +
          |year = {{{year2 | {{CURRENTYEAR}} }}}
 +
          |month = {{{month2 | {{CURRENTMONTH}} }}}
 +
          |day   = {{{day2   | {{CURRENTDAY}}   }}}
 +
        }}-
 +
        {{gsd <!-- Gregorian serial date -->
 +
          |year = {{{year1 | {{CURRENTYEAR}} }}}
 +
          |month = {{{month1 | {{CURRENTMONTH}} }}}
 +
          |day   = {{{day1   | {{CURRENTDAY}}   }}}
 +
        }})
 +
      }}
 +
    |7
 +
  }}|
 +
  day}}</includeonly><noinclude>
 +
 
 +
This template returns the number of weeks and days that have elapsed between two dates. If the second set of parameters is not included it will automatically calculate the period between a given date and today.
  
 
To use type: '''<nowiki>{{Age in weeks and days|month1= |day1= |year1= |month2= |day2= | year2=}}</nowiki>'''
 
To use type: '''<nowiki>{{Age in weeks and days|month1= |day1= |year1= |month2= |day2= | year2=}}</nowiki>'''

Revision as of 09:56, 7 April 2010


This template returns the number of weeks and days that have elapsed between two dates. If the second set of parameters is not included it will automatically calculate the period between a given date and today.

To use type: {{Age in weeks and days|month1= |day1= |year1= |month2= |day2= | year2=}}