Jump to content

Template:Start date: Difference between revisions

From Rave Wiki
Created page with "<includeonly><time class="dtstart" datetime="{{#time:c|{{{1}}}-{{{2|01}}}-{{{3|01}}} {{{4|00}}}:{{{5|00}}}:{{{6|00}}} {{{7|+00:00}}}}}"> {{#if:{{{3|}}} |{{#if:{{{2|}}} |{{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}} |{{#time:F Y|{{{1}}}-{{{2|01}}}-01}} }} |{{#time:Y|{{{1}}}}} }}</time></includeonly> <noinclude> == Usage == This template formats a start date in a Wikipedia-style format with a hidden ISO 8601 timestamp. === Syntax === <pre> {{Start date|year|month|da..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><time class="dtstart" datetime="{{#time:c|{{{1}}}-{{{2|01}}}-{{{3|01}}} {{{4|00}}}:{{{5|00}}}:{{{6|00}}} {{{7|+00:00}}}}}">
<includeonly>
{{#if:{{{3|}}}
{{{1}}}{{#if:{{{2|}}}|-{{{2}}}{{#if:{{{3|}}}|-{{{3}}}}}}}
|{{#if:{{{2|}}}
</includeonly>
  |{{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}}
  |{{#time:F Y|{{{1}}}-{{{2|01}}}-01}}
  }}
|{{#time:Y|{{{1}}}}}
}}</time></includeonly>


<noinclude>
<noinclude>
== Usage ==
== Template:Start date ==
This template formats a start date in a Wikipedia-style format with a hidden ISO 8601 timestamp.


=== Syntax ===
Simple display-only start date template.
<pre>
{{Start date|year|month|day|hour|minute|second|timezone}}
</pre>


=== Parameters ===
=== Usage ===
* {{{1}}} = Year (required)
* {{{2}}} = Month (optional)
* {{{3}}} = Day (optional)
* {{{4}}} = Hour (optional)
* {{{5}}} = Minute (optional)
* {{{6}}} = Second (optional)
* {{{7}}} = Timezone (optional, default +00:00)
 
=== Examples ===
<pre>
<pre>
{{Start date|2026|04|25}}
{{Start date|year|month|day}}
</pre>
</pre>
→ April 25, 2026


<pre>
=== Output ===
{{Start date|2026|04|25|14|30}}
* {{Start date|2026}} → 2026 
</pre>
* {{Start date|2026|04}} → 2026-04 
April 25, 2026 (with time included in metadata)
* {{Start date|2026|04|25}} → 2026-04-25


=== Notes ===
=== Notes ===
* Outputs a machine-readable `<time>` tag for semantic SEO and microformats.
* No parser functions required
* Similar in concept to Wikipedia’s `{{Start date}}` / `{{Start date and age}}`.
* 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