Template:Days since/doc: Difference between revisions

Safer nicotine wiki Tobacco Harm Reduction
Jump to navigation Jump to search
m (1 revision imported)
imported>JPxG
 
Line 4: Line 4:


== Usage ==
== Usage ==
{{tlx|Days since|{{CURRENTYEAR}}|01|01}} produces: {{Days since|{{CURRENTYEAR}}|01|01}}
This template is a facade for {{tl|Time ago}} which invokes that template to specifically return an integer of the amount of days since a given timestamp. {{tl|Time ago}} is a larger template, with many more options, that can be used for more customized output.


{{tlx|1=Days since|2={{CURRENTYEAR}}|3=01|4=01|5=short=yes}} produces: {{Days since|{{CURRENTYEAR}}|01|01|short=yes}}
There are two ways to use this template:
* With three parameters <code>YYYY-MM-DD</code>: {{tlx|Days since|{{CURRENTYEAR}}|06|13}}
* With one parameter. If this is done, the date MUST be formatted in one of these four ways:
**03 Dec 1969
**03 December 1969
**3 Dec 1969
**3 December 1969
Using this template with a single parameter is identical to using <code><nowiki>{{Time ago|03 Dec 1969|magnitude=days|ago=|numeric=y}}</nowiki></code>.


== Template data ==
{{tlx|Days since|1 Jan {{CURRENTYEAR}}}} produces: {{Days since|1 Jan {{CURRENTYEAR}}}}
{{TemplateData header}}
 
<templatedata>
{{tlx|Days since|{{CURRENTYEAR}}|06|13}} produces: {{Days since|{{CURRENTYEAR}}|06|13}}
{
 
"params": {
{{tlx|Days since|31 December 1969}} produces: {{Days since|31 December 1969}}
"1": {
"description": "Year",
"type": "number",
"required": true
},
"2": {
"description": "Month",
"type": "number",
"required": true
},
"3": {
"description": "Day",
"type": "number",
"required": true
},
"short": {
"description": "Uses \"d\" or \"m\" instead of \"months\" or \"days\" if set to \"yes\"",
"type": "string"
}
},
"description": "Shows the years/days (or months/days) since the entered date.",
"paramOrder": [
"1",
"2",
"3",
"short"
],
"format": "inline"
}
</templatedata>


<includeonly>{{sandbox other||
<includeonly>{{sandbox other||
Line 50: Line 27:


== See also ==
== See also ==
* [[Template:Time ago]] – more expansive set of functions, of which this template is a subset.
* [[Template:Birth date and age]] – show birthdate and age in years
* [[Template:Birth date and age]] – show birthdate and age in years
* [[Template:Years and days]] – show years and days for a count in days
* [[Template:Years and days]] – show years and days for a count in days
{{Sandbox other|<!-- Absolutely nothing. -->|}}
{{Sandbox other|<!-- Absolutely nothing. -->|}}

Latest revision as of 22:23, 28 June 2022

{{Days since}} shows the years/days (or months/days) since a specific date.

Usage

This template is a facade for {{Time ago}} which invokes that template to specifically return an integer of the amount of days since a given timestamp. {{Time ago}} is a larger template, with many more options, that can be used for more customized output.

There are two ways to use this template:

  • With three parameters YYYY-MM-DD: {{Days since|2024|06|13}}
  • With one parameter. If this is done, the date MUST be formatted in one of these four ways:
    • 03 Dec 1969
    • 03 December 1969
    • 3 Dec 1969
    • 3 December 1969

Using this template with a single parameter is identical to using {{Time ago|03 Dec 1969|magnitude=days|ago=|numeric=y}}.

{{Days since|1 Jan 2024}} produces: 123


{{Days since|2024|06|13}} produces: 0


{{Days since|31 December 1969}} produces: 19847



See also