Template:Expiry/doc
Jump to navigation
Jump to search
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.
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 | {{expiry|A very important task|2015|01|01}} |
A very important task | |
{{expiry|A very important task|2025|07|05}} |
A very important task | ||
{{expiry|A very important task|2115|01|01}} |
A very important task | ||
Date and hour | {{expiry|A very important task|2015|01|01|18}} |
A very important task | |
{{expiry|A very important task|2025|07|05|17}} |
A very important task | ||
{{expiry|A very important task|2115|01|01|18}} |
A very important task | ||
Date and time | {{expiry|A very important task|2015|01|01|18|35}} |
A very important task | |
{{expiry|A very important task|2025|07|05|17|35}} |
A very important task | ||
{{expiry|A very important task|2115|01|01|18|35}} |
A very important task |
See also
- {{mark}}: simple highlighting.