Template:Show during
{{show during}} can show a text during a specified period.
Usage
[edit]{{show during|start date|end date|text}}
text will be shown from start date to end date.
The date parameters can be in any format accepted by PHP's strtotime() function. See mw:Help:Extension:ParserFunctions##time for more information. A time of day will be ignored. The current date is decided by UTC. The evening in the United States may be the next day in UTC. The default start date and end date is today but both dates should usually be specified. Otherwise {{show by}} or {{show by date}} can be used.
If text contains an equals sign (e.g. in a url) then write |3=text
.
There is an optional |not=
parameter to show a different text outside the specified period. There is no option to display a different text before and after the period.
Example
[edit]Some event templates like {{Infobox GrandSlamTournaments}} have a current
or Current
parameter to link to a current edition of the event. Editors often forget to add or remove such links. {{Show during}} can be used as soon as the date is known. For example, Wimbledon Championships may add this in 2022:
|Current={{show during|26 June 2023|17 July 23|[[2023 Wimbledon Championships]]}}
If the template is used like this then don't remove it after the event. Set the time and text to the next event instead, or leave it alone if the time is unknown. It's easier to update the parameters later than to find and add the whole template.