Difference between revisions of "Template:Date nolink"
From Geohashing
imported>Benjw (date template to use for retro meetup maps) |
imported>Benjw m (oh good gracious, I'm so dim) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine:format|{{{2|l j F Y}}}}}{{#vardefine:text|{{#time:{{#var:format}}|{{{1}}} }} }} | + | <includeonly>{{#vardefine:format|{{{2|l j F Y}}}}}{{#vardefine:text|{{#time:{{#var:format}}|{{{1}}} }} }}{{#ifeq:{{#var:text}}|{{#time:{{#var:format}}|1969-12-31}}|{{{1}}}|{{#var:text}} }}</includeonly><noinclude> |
== Usage == | == Usage == | ||
− | This template does ''exactly'' the same think as [[:Template:Date link]] | + | This template does ''exactly'' the same think as [[:Template:Date link]], but does not turn the resulting text into a wiki link. It is therefore useful for the meetup graticule map template when the expedition is a ''[[retro]]'' and you do not wish the date to show up as a red link. |
+ | * First parameter takes date in '''YYYY-MM-DD''' format. Text is automatically based on this parameter. | ||
+ | * Optional second parameter takes a formatting string ''à la'' PHP's date() function. ''Defaults to <code>l j F Y</code> format.'' | ||
+ | ** <code><nowiki>{{date nolink|2008-06-21|l j F}}</nowiki></code> gives {{date nolink|2008-05-21|l j F}} | ||
+ | ** <code><nowiki>{{date nolink|2008-06-21|DdMY}}</nowiki></code> gives {{date nolink|2008-05-21|DdMY}} | ||
+ | ** <code><nowiki>{{date nolink|2008-06-21}}</nowiki></code> gives {{date nolink|2008-05-21}} | ||
</noinclude> | </noinclude> |
Latest revision as of 16:39, 9 August 2010
Usage
This template does exactly the same think as Template:Date link, but does not turn the resulting text into a wiki link. It is therefore useful for the meetup graticule map template when the expedition is a retro and you do not wish the date to show up as a red link.
- First parameter takes date in YYYY-MM-DD format. Text is automatically based on this parameter.
- Optional second parameter takes a formatting string à la PHP's date() function. Defaults to
l j F Y
format.{{date nolink|2008-06-21|l j F}}
gives Wednesday 21 May{{date nolink|2008-06-21|DdMY}}
gives Wed21May2008{{date nolink|2008-06-21}}
gives Wednesday 21 May 2008