Difference between revisions of "Template:Age in days addrem"

From Rigged Wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#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}} }}} }}...")
 
Line 10: Line 10:
                       |year = {{{year1|{{CURRENTYEAR}} }}}
                       |year = {{{year1|{{CURRENTYEAR}} }}}
           }}
           }}
         + {{Gregorian serial date
         + {{adddays|0}}
                      |month = {{{addmonth|{{CURRENTMONTH}} }}}
         - {{remdays|0}}
                      |day = {{{addday|{{CURRENTDAY}} }}}
           }}</includeonly><noinclude>[[Category:Date templates|{{PAGENAME}}]]
                      |year = {{{addyear|{{CURRENTYEAR}} }}}
          }}
         - {{Gregorian serial date
                      |month = {{{remmonth|{{CURRENTMONTH}} }}}
                      |day = {{{remday|{{CURRENTDAY}} }}}
                      |year = {{{remyear|{{CURRENTYEAR}} }}}
           }} }}</includeonly><noinclude>[[Category:Date templates|{{PAGENAME}}]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
</noinclude><noinclude>
</noinclude><noinclude>
Line 29: Line 22:
{{Parm|day2|day of month of end date|no (see note)|defaults to today's date}}
{{Parm|day2|day of month of end date|no (see note)|defaults to today's date}}
{{Parm|year2|year of end date|no (see note)|defaults to current year}}
{{Parm|year2|year of end date|no (see note)|defaults to current year}}
{{Parm|addmonth|months to remove|no (see note)|defaults to current month}}
{{Parm|adddays|days to add|no (see note)|defaults to 0}}
{{Parm|remdays|days to remove|no (see note)|defaults to 0}}
}}
}}
Modified version of [[Template:Age_in_days]], with the added ability to add or remove (or both) a number of days, months or years as well.
Modified version of [[Template:Age_in_days]], with the added ability to add or remove (or both) a number of days.


Note:  It is pointless omitting all parameters, as the calculation will then return zero (the number of days between today and today).
Note:  It is pointless omitting all parameters, as the calculation will then return zero (the number of days between today and today).

Revision as of 04:30, 30 April 2022


Template Parameters
(See using templates).
Name Purpose Required? Comment
month1 month of start date no (see note) defaults to current month
day1 day of month of start date no (see note) defaults to today's date
year1 year of start date no (see note) defaults to current year
month2 month of end date no (see note) defaults to current month
day2 day of month of end date no (see note) defaults to today's date
year2 year of end date no (see note) defaults to current year
adddays days to add no (see note) defaults to 0
remdays days to remove no (see note) defaults to 0

Modified version of Template:Age_in_days, with the added ability to add or remove (or both) a number of days.

Note: It is pointless omitting all parameters, as the calculation will then return zero (the number of days between today and today).

If the second set of parameters is not included it will automatically calculate the days between a given date and today. To use type: {{Age in days|month1= |day1= |year1= |month2= |day2= | year2=}}