[unchecked revision] | [unchecked revision] |
(Improve documentation.) |
m (→Examples: Fix incorrect example.) |
||
Line 45: | Line 45: | ||
| {{tlx|Template Sandbox/Demian/Datetime|2022-01-01T00:00:01}} || {{Template Sandbox/Demian/Datetime|2022-01-01T00:00:01}} | | {{tlx|Template Sandbox/Demian/Datetime|2022-01-01T00:00:01}} || {{Template Sandbox/Demian/Datetime|2022-01-01T00:00:01}} | ||
|- | |- | ||
| {{tlx|Template Sandbox/Demian/Datetime}} || {{Template Sandbox/Demian/Datetime | | {{tlx|Template Sandbox/Demian/Datetime}} || {{Template Sandbox/Demian/Datetime}} | ||
|} | |} | ||
{{doc/end}} | {{doc/end}} | ||
<includeonly>[[Category:Formatting templates]]</includeonly> | <includeonly>[[Category:Formatting templates]]</includeonly> |
Revision as of 18:58, 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 |
---|---|
{{Template Sandbox/Demian/Datetime|2022-01-02}} |
|
{{Template Sandbox/Demian/Datetime|2022-02-01|In February}} |
|
{{Template Sandbox/Demian/Datetime|12:30|half past noon}} |
|
{{Template Sandbox/Demian/Datetime|2022-01-01T00:00:01}} |
|
{{Template Sandbox/Demian/Datetime}} |
ERROR: No value given to datetime template! |