Jump to content

Template:Start date: Difference between revisions

From Rave Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
{{#ifeq:{{{3|}}}||
{{{1}}}{{#if:{{{2|}}}|-{{{2}}}{{#if:{{{3|}}}|-{{{3}}}}}}}
  {{#if:{{{2|}}}||
    {{#time:F Y|{{{1}}}-{{{2|1}}}-1}}
  |
    {{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}}
  }}
|
  {{#time:Y|{{{1}}}}}
}}
</includeonly>
</includeonly>


Line 14: Line 6:
== Template:Start date ==
== Template:Start date ==


Formats a start date in a Wikipedia-style human-readable form.
Simple display-only start date template.


=== Usage ===
=== Usage ===
Line 21: Line 13:
</pre>
</pre>


=== Examples ===
=== Output ===
 
* {{Start date|2026}} → 2026
<pre>
* {{Start date|2026|04}} → 2026-04 
{{Start date|2026}}
* {{Start date|2026|04|25}} → 2026-04-25
</pre>
→ 2026
 
<pre>
{{Start date|2026|4}}
</pre>
April 2026
 
<pre>
{{Start date|2026|4|25}}
</pre>
April 25, 2026


=== Notes ===
=== Notes ===
* Month and day are optional.
* No parser functions required
* Designed for clean display (no broken ISO or time complexity).
* No extensions required
* Works on all MediaWiki versions
</noinclude>
</noinclude>

Latest revision as of 23:39, 25 April 2026


Template:Start date

[edit]

Simple display-only start date template.

Usage

[edit]
{{Start date|year|month|day}}

Output

[edit]

2026{{#if:|-{{{2}}}{{#if:|-{{{3}}}}}}}


→ 2026  

2026{{#if:04|-04{{#if:|-{{{3}}}}}}}


→ 2026-04  

2026{{#if:04|-04{{#if:25|-25}}}}


→ 2026-04-25  

Notes

[edit]
  • No parser functions required
  • No extensions required
  • Works on all MediaWiki versions