|
|
|
<countdown/>
Provided by module: Tags: Countdown
This tag can count days, minutes, months, etc. from a specified date
or time. It can also give the time to or from a few special
events. See below for a full list.
Attributes
Time:
- year="number"
-
Sets the year to count down to.
- month="{number, month_name}"
-
Sets the month to count down to. If given as a
number January is 1.
- day="{number, day_name}"
-
Sets the weekday to count down to. If given as
a number Sunday is 1.
- mday="number"
-
Sets the day of the month to count down to.
- hour="number"
-
Sets the hour to count down to.
- minute="number"
-
Sets the minute to count down to.
- second="number"
-
Sets the second to count down to.
- iso="year-month-day"
-
Sets the year, month and day to count down to.
(YYYY-MM-DD, YYYYMMDD or YYYY-MMM-DD).
<countdown iso='2020-FEB-12'/> |
2890 days |
- event="easter,gregorian-easter,julian-easter,christmas,christmas-day,christmas-eve"
-
Sets the time of an event to count down to.
- years="number"
-
Add this number of years to the result.
- months="number"
-
Add this number of months to the result.
- weeks="number"
-
Add this number of weeks to the result.
- days="number"
-
Add this number of days to the result.
- hours="number"
-
Add this number of hours to the result.
- beats="number"
-
Add this number of beats to the result.
- minutes="number"
-
Add this number of minutes to the result.
- seconds="number"
-
Add this number of seconds to the result.
- now="year-month-day"
-
Sets the 'present' time, if other than really present time. (YYYY-MM-DD, YYYYMMDD or YYYY-MMM-DD)
<countdown now="1999-12-24" year="2000" display="days"/> |
8 |
Presentation:
- display="{when, years, months, weeks, days, hours, beats, minutes, seconds, combined, dogyears, boolean}"
-
- display=when
-
Shows when the time will occur. All arguments that are valid in
<date> can be used to modify the display.
- display=years
-
How many years until the time.
- display=months
-
How many months until the time.
- display=weeks
-
How many weeks until the time.
- display=days
-
How many days until the time.
- display=hours
-
How many hours until the time.
<countdown day='friday' display='hours'/> |
28 |
- display=beats
-
How many beats until the time.
- display=minutes
-
How many minutes until the time.
- display=seconds
-
How many seconds until the time.
- display=combined
-
Shows an english text describing the time period.
Example: 2 days, 1 hour and 5 seconds. You may use the 'prec'
attribute to limit how precise the description is. Also, you can
use the 'month' attribute if you want to see years/months/days
instead of years/weeks/days.
The world will go under in <countdown year='2038' display='combined' prec='day'/>. |
The world will go under in 25 years, 9 months and 18 days. |
- display=dogyears
-
How many dog-years until the time. (With one decimal)
<countdown years='2' display='dogyears'/> |
14.0 |
- display=boolean
-
Return true or false (1 or 0), depending on if the time is now or not. The fuzziness of 'now' is decided by the 'prec' option.
<b>Is this a Sunday?</b>
<define variable='var.test' preparse=''><countdown day='sunday' display='boolean'/></define>
<if variable='var.test = 1'>Yes, this is a Sunday.</if>
<else>No, it isn't.</else> |
Is this a Sunday?
No, it isn't. |
- type="type"
-
As for 'date'. Useful values for type include string, number and ordered.
- lang="langcodes"
-
The language in which the result should be written if the type is string.
Heute ist es ungefähr <countdown event='christmas' display='months' type='string' lang='de'/> Monate bis Weinachten. |
Heute ist es ungefähr neun Monate bis Weinachten. |
- since
-
Negate the period of time.
I am <countdown iso='1980-06-28' since='' display='years' type='string'/> years old. |
I am thirtyone years old. |
- next
-
Always count down to the next event.
<countdown day='friday' next=''> says 6 on a friday as opposed
to 0 without the next attribute.
It is <countdown day='monday' next=''/> to monday. |
It is 4 days to monday. |
- prec="{year, month, week, day, hour, minute, second}"
-
Modifies the precision for 'boolean'- and 'combined'-arguments.
|
|