[unchecked revision] | [unchecked revision] |
m (Demian moved page Template:Template Sandbox/Demian/Datetime/doc to Template:Datetime/doc: Move template out of sandbox: ready for use.) |
m (Remove references to sandbox.) |
||
Line 37: | Line 37: | ||
! Code !! Result | ! Code !! Result | ||
|- | |- | ||
| {{tlx| | | {{tlx|Datetime|2022-01-02}} || {{Datetime|2022-01-02}} | ||
|- | |- | ||
| {{tlx| | | {{tlx|Datetime|2022-02-01|On February 1st}} || {{Datetime|2022-02-01|On February 1st}} | ||
|- | |- | ||
| {{tlx| | | {{tlx|Datetime|12:30|half past noon}} || {{Datetime|12:30|half past noon}} | ||
|- | |- | ||
| {{tlx| | | {{tlx|Datetime|2022-01-01T00:00:01}} || {{Datetime|2022-01-01T00:00:01}} | ||
|- | |- | ||
| {{tlx| | | {{tlx|Datetime}} || {{Datetime}} | ||
|} | |} | ||
{{doc/end}} | {{doc/end}} | ||
<includeonly>[[Category:Formatting templates]]</includeonly> | <includeonly>[[Category:Formatting templates]]</includeonly> |
Revision as of 19:01, 26 February 2022
Add the "time" HTML element around a date, time, or date & time text for better search engine results and to help people using accessibility technologies.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Datetime | 1 | String with a date, time, or date and time.
| String | required |
Display text | 2 | Text to display instead of the date or time.
| String | optional |
Please refer to the <time>: The (Date) Time element on MDN Web Docs for the exact specification of the datetime string and more examples.
Usage
- With date only:
{{Template_Sandbox/Demian/Datetime|datetime}}
- With date and text:
{{Template_Sandbox/Demian/Datetime|datetime|display text}}
Examples
Code | Result |
---|---|
{{Datetime|2022-01-02}} |
|
{{Datetime|2022-02-01|On February 1st}} |
|
{{Datetime|12:30|half past noon}} |
|
{{Datetime|2022-01-01T00:00:01}} |
|
{{Datetime}} |
ERROR: No value given to datetime template! |