Template:Expiry
Expression error: Unexpected < operator.
Usage
{{expiry}} indicates when an entry expires (task, event, etc.). It does so by highlighting the entered text in three different colours, depending on how the current date and time relates to the entered expiry time.
- – more than 24 hours until the expiry time.
- – less than 24 hours until the expiry time.
- – expired.
Limitations
This wiki caches its pages. In order to see any changes to entries using this template, you need to refresh the page. You can do so by choosing Refresh in the drop-down menu to the left of the wiki's search bar.
Parameters
There are 6 parameters, all unnamed, of which 4 are required and the remaining 2 are optional.
Syntax
The template's syntax is
-
{{expiry|custom text |year (4 digits) |month (2 digits) |day (2 digits) |hours (2 digits) |minutes (2 digits) }}
Expiry date
- The year, month and day of expiration are required.
Expiry time
- If only the hour of expiration is specified, the template will assume that the expiry time is at the start of that hour, i.e. at HH:00.
- If no expiry time is entered, the template will assume that the expiry time is at 23:59:59 (one second to midnight) at the specified date.
Required parameters
1
- Custom text
This is the text that will be highlighted.
- Notes
- It's possible to use wiki-formatting.
- Usage
-
{{expiry|1|2|3|4|5|6}}
2
- Year
The year of the expiry date.
- Notes
- Must be entered as 4 digits; e.g. 2015, not 15 or '15.
- Since the template uses Unix time, the input year must conform to the Gregorian calendar.
- Usage
-
{{expiry|1|2|3|4|5|6}}
3
- Month
The month of the expiry date.
- Notes
- Must be entered as 2 digits, units padded with a leading zero; e.g. 09, not 9, Sept or September.
- Since the template uses Unix time, the input month must conform to the Gregorian calendar.
- Usage
-
{{expiry|1|2|3|4|5|6}}
4
- Day
The day of the expiry date.
- Notes
- Must be entered as 2 digits, units padded with a leading zero; e.g. 09, not 9, Fri or Friday.
- Since the template uses Unix time, the input day must conform to the Gregorian calendar.
- Usage
-
{{expiry|1|2|3|4|5|6}}
Optional parameters
5
- Hours
The hour of the expiry time in the 24-hours format.
- Notes
- Must be entered as 2 digits, units padded with a leading zero; e.g. 09, not 9.
- Since the template uses Unix time, the input hour must conform to the 24-hours format; e.g. 19, not 7 or 7pm.
- Usage
-
{{expiry|1|2|3|4|5|6}}
6
- Minutes
The minute of the expiry time.
- Notes
- Must be entered as 2 digits, units padded with a leading zero; e.g. 09, not 9.
- Usage
-
{{expiry|1|2|3|4|5|6}}
Examples
Correct use
Case | What you type | What you see | Comments |
---|---|---|---|
Date | A very important task|2015|01|01}} | A very important task | |
A very important task|2024|11|22}} | A very important task | ||
A very important task|2115|01|01}} | A very important task | ||
Date and hour | A very important task|2015|01|01|18}} | A very important task | |
A very important task|2024|11|22|23}} | A very important task | ||
A very important task|2115|01|01|18}} | A very important task | ||
Date and time | A very important task|2015|01|01|18|35}} | A very important task | |
A very important task|2024|11|22|23|35}} | A very important task | ||
A very important task|2115|01|01|18|35}} | A very important task |
See also
- {{expiry icon}}: performs the same task as this template, but displays an icon instead of highlighted text.
- {{mark}}: simple highlighting.
The above documentation is transcluded from Template:Expiry/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |