Jump to content

Template:Start date: Difference between revisions

From RetroTechCollection
No edit summary
No edit summary
ย 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- =========================================================
<!-- =========================================================
Template:Start date ย  ยทย  inline, micro-formatted, no box
ย  ย  Template:Start date โ€”ย  returns an inline, non-wrapping
========================================================= -->
ย  ย  โ€œMonth day, Yearโ€ string (e.g. โ€œDecember 12, 1991โ€)
<includeonly>
============================================================= -->
<span class="dtstart" title="{{#time:Y-m-d|{{{1}}}-{{{2|01}}}-{{{3|01}}}}}"
<includeonly><span class="nowrap">{{#time:F j, Y|{{{1}}}-{{{2|1}}}-{{{3|1}}}}}</span></includeonly><noinclude>
ย  ย  ย  style="white-space:nowrap;">
{{#time:F j, Y|{{{1}}}-{{{2|1}}}-{{{3|1}}}}}
</span>
</includeonly><noinclude>
== Usage ==
== Usage ==
<syntaxhighlight lang="text">
* `{{Start date|1991|12|12}}` โ†’ '''December 12, 1991'''
{{Start date|YYYY|MM|DD}}
* `{{Start date|1992|10|15}}` โ†’ '''October 15, 1992'''
</syntaxhighlight>
* You may omit the day or month: `{{Start date|1993|05}}` โ†’ '''May 1993'''
* '''YYYY''' (required) โ€“ 4-digit yearย 
* '''MM''' (optional) โ€“ month&nbsp;1โ€“12 (defaults to 1)ย 
* '''DD''' (optional) โ€“ day&nbsp;1โ€“31ย  (defaults to 1)


=== Examples ===
The template purposely contains **no leading / trailing spaces** or newlines so it can be
; Full date
embedded inside tables (e.g. infobox cells) without triggering unwanted
:<code><nowiki>{{Start date|1991|12|12}}</nowiki></code> โ†’ {{Start date|1991|12|12}}
paragraph (`<p>`) or preformatted (`<pre>`) blocks.
; Month & year
:<code><nowiki>{{Start date|1992|10}}</nowiki></code> โ†’ {{Start date|1992|10}}
; Year only
:<code><nowiki>{{Start date|1993}}</nowiki></code> โ†’ {{Start date|1993}}


[[Category:Date formatting templates]]
The `nowrap` class (MediaWiki core) keeps the entire date on a single
line, avoiding ugly breaks inside infoboxes.ย 
</noinclude>
</noinclude>

Latest revision as of 12:17, 27 April 2025


  • `

December 12, 1991` โ†’ December 12, 1991

  • `

October 15, 1992` โ†’ October 15, 1992

  • You may omit the day or month: `

May 1, 1993` โ†’ May 1993

The template purposely contains **no leading / trailing spaces** or newlines so it can be embedded inside tables (e.g. infobox cells) without triggering unwanted

paragraph (`

`) or preformatted (`

`) blocks.

The `nowrap` class (MediaWiki core) keeps the entire date on a single
line, avoiding ugly breaks inside infoboxes.