Template:Signpost/DateCountdown/doc

Source: Wikipedia, the free encyclopedia.

For this:


Utility template for {{Signpost/Deadline}}. Displays a horizontal "progress" bar representing the amount of time remaining in a time span, color-coded (green → yellow → red) to indicate how close it is to the end of the span.

The bar is overlaid with various pieces of information:

  • an optional text label
  • an offsite link to convert the displayed UTC time to local timezones
  • and, if |short= is not enabled:
    • the proximity to the end date expressed in number of days "left", or "ago" (for past dates)
    • the percentage value of the time remaining

Parameters

|start=YYYY-MM-DD
The start of the span.
|end=YYYY-MM-DD HH:NN UTC
The end of the span. (Optional time values default to 00:00 UTC.)
|label=text
Optional text label to precede the |end= date, when labeling the bar.
|short=truthy value
If set, disables the days left/ago labeling and the percentage display.
|width=number or percentage
Optional CSS width for the bar, defaults to 100%. Values followed by a percent sign are interpreted as percentages, all others in pixel (px) units.

Example

How much remains of the current calendar month:

{{Signpost/DateCountdown
|label=End of month:{{sp}}
|start={{#time:Y-m"-01"|now}}
|end={{#time:Y-m-d|{{#time:Y-m"-01"|now}} + 1 month}}
}}


End of month: 1 May 00:00 (6 days left; 20%)