Difference between revisions of "Template:Age in weeks 2"

From blackwiki
Jump to navigation Jump to search
blackwiki>Oakster
(Created page with '<noinclude>This template returns the number of weeks that have elapsed between two dates and times. If the second set of parameters is not included it will automati...')
 
m (2 revisions imported)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<noinclude>This template returns the number of weeks that have elapsed between two dates and times. If the second set of parameters is not included it will automatically calculate the days between a given date and today. Unlike [[Template:Age in weeks]], this template also utilizes time. To use type: '''<nowiki>{{Age in weeks 2|month1= |day1= |year1= |hour1= |minute1= |month2= |day2= | year2= |hour2= |minute2=}}</nowiki>'''
+
#redirect [[Template:Age in weeks]]
</noinclude><includeonly>{{#expr:floor {{#expr:
 
          ((
 
        + {{Gregorian serial date
 
                      |month = {{{month2|{{CURRENTMONTH}}}}}
 
                      |day = {{{day2|{{CURRENTDAY}}}}}
 
                      |year = {{{year2|{{CURRENTYEAR}}}}}
 
          }}
 
        - {{Gregorian serial date
 
                      |month = {{{month1|{{CURRENTMONTH}}}}}
 
                      |day = {{{day1|{{CURRENTDAY}}}}}
 
                      |year = {{{year1|{{CURRENTYEAR}}}}}
 
          }}
 
          )
 
        / 7)
 
        - {{#ifexpr: {{#expr:{{{hour2|{{CURRENTHOUR}}}}}*100+{{{minute2|{{CURRENTMINUTE}}}}} >= {{{hour1|{{CURRENTHOUR}}}}}*100+{{{minute1|{{CURRENTMINUTE}}}}}}} | 0 | 1 }}
 
        }} }}</includeonly><noinclude>[[Category:Date mathematics templates|{{PAGENAME}}]]
 
</noinclude>
 

Latest revision as of 12:35, 18 October 2020