Template:Scheduled Show: Difference between revisions

From Hololive Fan Wiki
Content added Content deleted
mNo edit summary
(now using the time function's built-in parsing of date/time objects instead of however I was doing it before)
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#time:xnYmdHi|+9 hours}} < {{{1|}}}{{#ifexpr:{{{1|}}} < 100000000000 | * 10000 }} | {{{2|}}} | {{{3|}}} }}</includeonly><noinclude>
<includeonly>{{#ifexpr:{{#timel:xnYmdHi}}<{{#timel:xnYmdHi|{{{1|}}}}}|{{{2|}}}|{{{3|}}}}}</includeonly><noinclude>
Use this template to show different content depending on the time and date. The content can be a just single sentence, other templates, an entire section, or even an entire page!<ref>Your mileage may vary. Having multiple tables within the same parameter is known to cause issues. In general, please be mindful when trying to encapsulate large amounts of content in one template.</ref>
Use this template to show different content depending on the time and date. The content can be a just single sentence, other templates, an entire section, or even an entire page!<ref>Your mileage may vary. Having multiple tables within the same parameter is known to cause issues. In general, please be mindful when trying to encapsulate large amounts of content in one template.</ref>
This template uses Japan Standard Time (JST), which is GMT+9.
This template uses Japan Standard Time (JST), which is GMT+9.
Line 5: Line 5:
== Usage ==
== Usage ==
<pre>
<pre>
{{Scheduled Show|When|A|B}}
{{Scheduled Show|date/time object|A|B}}
</pre>
</pre>
* '''date/time object''': Can be any date/time object accepted MediaWiki's [https://en.wikipedia.org/wiki/Help:Time_function time function].
* '''When''': Must be either
** a 12-digit date and time (in JST) in <code>YYYYMMDDhhmm</code> format or,
** an 8-digit date in <code>YYYYMMDD</code> format. Equivalent to <code>YYYYMMDD0000</code>.
* '''A''': Optional. The content you wish to show ''before'' the given time
* '''A''': Optional. The content you wish to show ''before'' the given time
* '''B''': Optional. The content you wish to show ''during'' and ''after'' the given time.
* '''B''': Optional. The content you wish to show ''during'' and ''after'' the given time.
Line 17: Line 15:
! Markup !! Description
! Markup !! Description
|-
|-
| <pre>{{Scheduled Show|202108011200|A}}</pre> || Show content '''A''' until '''01 Aug 2021 12:00''', and then nothing afterwards.
| <pre>{{Scheduled Show|01 Aug 2021 12:00|A}}</pre> || Show content '''A''' until '''01 Aug 2021 12:00''', and then nothing afterwards.
|-
|-
| <pre>{{Scheduled Show|202108011200||B}}</pre> || Do not show content '''B''' until '''01 Aug 2021 12:00'''.
| <pre>{{Scheduled Show|2021-08-01 12:00||B}}</pre> || Do not show content '''B''' until '''01 Aug 2021 12:00'''.
|-
|-
| <pre>{{Scheduled Show|20210701|A|B}}</pre> || Show content '''A''' until '''01 Aug 2021 00:00''', and then content '''B''' afterwards.
| <pre>{{Scheduled Show|August 01, 2021|A|B}}</pre> || Show content '''A''' until '''01 Aug 2021 00:00''', and then content '''B''' afterwards.
|-
|-
| <pre>{{Scheduled Show|20210801|A|{{Scheduled Show|20210901|B|C}}}}</pre> || Show content '''A''' until '''01 Aug 2021 00:00''', and then content '''B''' until '''01 Sep 2021 00:00''', and then content '''C''' afterwards.
| <pre>{{Scheduled Show|2021-08-01|A|{{Scheduled Show|2021-09-01|B|C}}}}</pre> || Show content '''A''' until '''01 Aug 2021 00:00''', and then content '''B''' until '''01 Sep 2021 00:00''', and then content '''C''' afterwards.
|}
|}



Revision as of 15:45, 8 August 2021

Use this template to show different content depending on the time and date. The content can be a just single sentence, other templates, an entire section, or even an entire page![1] This template uses Japan Standard Time (JST), which is GMT+9.

  1. Your mileage may vary. Having multiple tables within the same parameter is known to cause issues. In general, please be mindful when trying to encapsulate large amounts of content in one template.

Usage

{{Scheduled Show|date/time object|A|B}}
  • date/time object: Can be any date/time object accepted MediaWiki's time function.
  • A: Optional. The content you wish to show before the given time
  • B: Optional. The content you wish to show during and after the given time.

Examples

Markup Description
{{Scheduled Show|01 Aug 2021 12:00|A}}
Show content A until 01 Aug 2021 12:00, and then nothing afterwards.
{{Scheduled Show|2021-08-01 12:00||B}}
Do not show content B until 01 Aug 2021 12:00.
{{Scheduled Show|August 01, 2021|A|B}}
Show content A until 01 Aug 2021 00:00, and then content B afterwards.
{{Scheduled Show|2021-08-01|A|{{Scheduled Show|2021-09-01|B|C}}}}
Show content A until 01 Aug 2021 00:00, and then content B until 01 Sep 2021 00:00, and then content C afterwards.

Considerations

Because the MediaWiki software uses extensive caching, your scheduled content will not update immediately upon reaching the scheduled time. If you're impatient, use Special:Purge on the target page to flush the server's cache and force the page to update.