Template:Expiry/doc: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "{{documentation subpage}} __NOTOC__ ==Usage== {{tlf|'''expiry'''}} indicates when an entry expires (task, event, etc.). It does so by highlighting the entered text in three di...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
* {{colsamp|#ffe800|valign=middle}} – less than 24 hours until the expiry time.
* {{colsamp|#ffe800|valign=middle}} – less than 24 hours until the expiry time.
* {{colsamp|#fe5442|valign=middle}} – expired.
* {{colsamp|#fe5442|valign=middle}} – 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==
==Parameters==
Line 30: Line 33:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''1'''</big>}}
* {{tlc|expiry|<big>'''1'''</big>|2|3|4|5|6}}


====2====
====2====
Line 41: Line 44:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''2'''</big>}}
* {{tlc|expiry|1|<big>'''2'''</big>|3|4|5|6}}


====3====
====3====
Line 52: Line 55:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''3'''</big>}}
* {{tlc|expiry|1|2|<big>'''3'''</big>|4|5|6}}


====4====
====4====
Line 63: Line 66:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''4'''</big>}}
* {{tlc|expiry|1|2|3|<big>'''4'''</big>|5|6}}


===Optional parameters===
===Optional parameters===
Line 75: Line 78:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''5'''</big>}}
* {{tlc|expiry|1|2|3|4|<big>'''5'''</big>|6}}


====6====
====6====
Line 85: Line 88:


;<big>Usage</big>
;<big>Usage</big>
* {{tlc|expiry|<big>'''6'''</big>}}
* {{tlc|expiry|1|2|3|4|5|<big>'''6'''</big>}}


==Examples==
==Examples==
Line 95: Line 98:
| rowspan="3" | Date || {{tlc|expiry|A very important task|2015|01|01}} || {{expiry|A very important task|2015|01|01}} ||
| rowspan="3" | Date || {{tlc|expiry|A very important task|2015|01|01}} || {{expiry|A very important task|2015|01|01}} ||
|-
|-
| {{tlc|expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}}} || {{expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}}} ||
| {{tlc|expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}}} || {{expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}}} ||
|-
|-
| {{tlc|expiry|A very important task|2115|01|01}} || {{expiry|A very important task|2115|01|01}} ||
| {{tlc|expiry|A very important task|2115|01|01}} || {{expiry|A very important task|2115|01|01}} ||
Line 101: Line 104:
| rowspan="3" | Date and hour || {{tlc|expiry|A very important task|2015|01|01|18}} || {{expiry|A very important task|2015|01|01|18}} ||
| rowspan="3" | Date and hour || {{tlc|expiry|A very important task|2015|01|01|18}} || {{expiry|A very important task|2015|01|01|18}} ||
|-
|-
| {{tlc|expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}|{{LOCALHOUR}}}} || {{expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}|{{LOCALHOUR}}}} ||
| {{tlc|expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}|{{LOCALHOUR}}}} || {{expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}|{{LOCALHOUR}}}} ||
|-
|-
| {{tlc|expiry|A very important task|2115|01|01|18}} || {{expiry|A very important task|2115|01|01|18}} ||
| {{tlc|expiry|A very important task|2115|01|01|18}} || {{expiry|A very important task|2115|01|01|18}} ||
Line 107: Line 110:
| rowspan="3" | Date and time || {{tlc|expiry|A very important task|2015|01|01|18|35}} || {{expiry|A very important task|2015|01|01|18|35}} ||
| rowspan="3" | Date and time || {{tlc|expiry|A very important task|2015|01|01|18|35}} || {{expiry|A very important task|2015|01|01|18|35}} ||
|-
|-
| {{tlc|expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}|{{LOCALHOUR}}|35}} || {{expiry|A very important task|{{LOCALYEAR}}|{{LOCALMONTH}}|{{LOCALDAY2}}|{{LOCALHOUR}}|35}} ||
| {{tlc|expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}|{{LOCALHOUR}}|35}} || {{expiry|A very important task|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY2}}|{{LOCALHOUR}}|35}} ||
|-
|-
| {{tlc|expiry|A very important task|2115|01|01|18|35}} || {{expiry|A very important task|2115|01|01|18|35}} ||
| {{tlc|expiry|A very important task|2115|01|01|18|35}} || {{expiry|A very important task|2115|01|01|18|35}} ||
Line 113: Line 116:


==See also==
==See also==
* {{tl|expiry icon}}: performs the same task as this template, but displays an icon instead of highlighted text.
* {{tl|mark}}: simple highlighting.
* {{tl|mark}}: simple highlighting.



Latest revision as of 10:28, 21 January 2015

Edit-copy green.svg
This is a documentation subpage for Template:Expiry.
It contains usage information, categories and other content that is not part of the original template page.

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 {{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

  • {{expiry icon}}: performs the same task as this template, but displays an icon instead of highlighted text.
  • {{mark}}: simple highlighting.