Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

-

Historians wanted: Inquire here.

Template:Pretty date: Difference between revisions

Template page
Create template
 
m Add TemplateData
Line 5: Line 5:
* {{pretty date|1969-07-21}}
* {{pretty date|1969-07-21}}
* {{pretty date|19 January 2038}}
* {{pretty date|19 January 2038}}
{{TemplateData preamble}}<templatedata>
{
"params": {
"1": {
"label": "Date",
"description": "please use YYYY-MM-DD",
"example": "2006-11-26",
"type": "date",
"required": true
}
},
"format": "inline",
"description": "Formats a date, e.g. \"2006-11-26\" becomes \"Sun, Nov 26th 2006\"."
}
</templatedata>

Revision as of 17:20, 30 October 2023

Formats a date similarly to how the format string D, M j Y for ParserFunctions' {{#time}} would, but with an ordinal for the DoM. Examples:

  • Sun, Nov 26th 2006
  • Mon, Jul 21st 1969
  • Tue, Jan 19th 2038

The below documentation is automatically generated from JSON.

It can be changed by editing this page, but note that it's only the documentation (for the visual editor)—the actual template part must also be edited, manually.

Formats a date, e.g. "2006-11-26" becomes "Sun, Nov 26th 2006".

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Date1

please use YYYY-MM-DD

Example
2006-11-26
Daterequired