Template:Trim date: Difference between revisions
Appearance
m Protected "Template:Trim date": Highly visible template; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite)) |
m 1 revision imported |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{plain space|1={{#invoke:String|replace|source={{#invoke:String|replace|source={{{1<noinclude>|{{start-date|{{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}}}</noinclude>}}}|pattern=<.-mw%-formatted%-date.->|replace=|plain=false}}|pattern= <.*>|replace=|plain=false}}}}<noinclude> | {{plain space|1={{#invoke:unstrip|killMarkers|{{#invoke:String|replace|source={{#invoke:String|replace|source={{{1<noinclude>|{{start-date|{{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}}}</noinclude>}}}|pattern=<.-mw%-formatted%-date.->|replace=|plain=false}}|pattern= <.*>|replace=|plain=false}}}}}}<noinclude> | ||
{{ | {{documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 15:51, 7 June 2024
April 19, 2025
Usage
{{Trim date|1=date}}
Trims all hidden text and microformats from dates output by {{Start date}}, {{Start-date}}, {{End date}}, and {{End-date}}. This template is of interest to template writers only.
For example, {{#time:Y|{{End date|2007|3|30}}}}
produces:
Error: Invalid time.
However, {{#time:Y|{{Trim date|{{End date|2007|3|30}}}}}}
produces:
2007
See also
- {{Start date}}
- {{Start-date}}
- {{End date}}
- {{End-date}}