Difference between revisions of "Template:Age in days addrem"
Ryperiour2 (talk | contribs) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 25: | Line 25: | ||
{{Parm|remdays|days to remove|no (see note)|defaults to 0}} | {{Parm|remdays|days to remove|no (see note)|defaults to 0}} | ||
}} | }} | ||
Modified version of [[Template: | 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). | ||
If the second set of parameters is not included it will automatically calculate the days between a given date and today. To use type: '''<nowiki>{{Age in days|month1= |day1= |year1= |month2= |day2= | year2=}}</nowiki>''' | If the second set of parameters is not included it will automatically calculate the days between a given date and today. To use type: '''<nowiki>{{Age in days addrem|month1= |day1= |year1= |month2= |day2= | year2= |adddays= | remdays= }}</nowiki>''' | ||
== Examples == | |||
Zero parameters | |||
<pre>{{Age in days addrem}}</pre> → {{Age in days addrem}}<br> | |||
Zero parameters - 27 Days | |||
<pre>{{Age in days addrem|remdays=27}}</pre> → {{Age in days addrem|remdays=27}}<br> | |||
Zero parameters + 27 Days | |||
<pre>{{Age in days addrem|adddays=27}}</pre> → {{Age in days addrem|adddays=27}}<br> | |||
First set of parameters only - 69 days (Start date January 1st, 2020 ({{Age in days|month1=1|day1=1|year1=2020}} days from today)) | |||
<pre>{{Age in days addrem|month1=1|day1=1|year1=2020|remdays=69}}</pre> → {{Age in days addrem|month1=1|day1=1|year1=2020|remdays=69}}<br> | |||
First set of parameters only + 69 days (Start date January 1st, 2020 ({{Age in days|month1=1|day1=1|year1=2020}} days from today)) | |||
<pre>{{Age in days addrem|month1=1|day1=1|year1=2020|adddays=69}}</pre> → {{Age in days addrem|month1=1|day1=1|year1=2020|adddays=69}}<br> | |||
Second set of parameters only - 200 days (End date January 1st, 2020 ({{Age in days|month2=1|day2=1|year2=2020}} days from today)) | |||
<pre>{{Age in days addrem|month2=1|day2=1|year2=2020|remdays=200}}</pre> → {{Age in days addrem|month2=1|day2=1|year2=2020|remdays=200}}<br> | |||
Second set of parameters only + 200 days (End date January 1st, 2020 ({{Age in days|month2=1|day2=1|year2=2020}} days from today)) | |||
<pre>{{Age in days addrem|month2=1|day2=1|year2=2020|adddays=200}}</pre> → {{Age in days addrem|month2=1|day2=1|year2=2020|adddays=200}}<br> | |||
Both sets of parameters - 319 Days (January 1st, 2020 to January 1st, 2022) | |||
<pre>{{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|remdays=319}}</pre> → {{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|remdays=319}} <br> | |||
Both sets of parameters + 319 Days (January 1st, 2020 to January 1st, 2022) | |||
<pre>{{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|adddays=319}}</pre> → {{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|adddays=319}} <br> | |||
</noinclude> | </noinclude> |
Latest revision as of 05:07, 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 addrem|month1= |day1= |year1= |month2= |day2= | year2= |adddays= | remdays= }}
Examples
Zero parameters
{{Age in days addrem}}
→ 0
Zero parameters - 27 Days
{{Age in days addrem|remdays=27}}
→ -27
Zero parameters + 27 Days
{{Age in days addrem|adddays=27}}
→ 27
First set of parameters only - 69 days (Start date January 1st, 2020 (1792 days from today))
{{Age in days addrem|month1=1|day1=1|year1=2020|remdays=69}}
→ 1723
First set of parameters only + 69 days (Start date January 1st, 2020 (1792 days from today))
{{Age in days addrem|month1=1|day1=1|year1=2020|adddays=69}}
→ 1861
Second set of parameters only - 200 days (End date January 1st, 2020 (-1792 days from today))
{{Age in days addrem|month2=1|day2=1|year2=2020|remdays=200}}
→ -1992
Second set of parameters only + 200 days (End date January 1st, 2020 (-1792 days from today))
{{Age in days addrem|month2=1|day2=1|year2=2020|adddays=200}}
→ -1592
Both sets of parameters - 319 Days (January 1st, 2020 to January 1st, 2022)
{{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|remdays=319}}
→ 412
Both sets of parameters + 319 Days (January 1st, 2020 to January 1st, 2022)
{{Age in days addrem|month1=1|day1=1|year1=2020|month2=1|day2=1|year2=2022|adddays=319}}
→ 1050