Plugin Countdown
This Wiki Plugin displays a countdown to a future date. Or, if parameter start is set, also since a date in the past.The enddate value provided by the user is converted from the user's local time to GMT/UTC date and time. Thus values will show hours until or since the current hour in GMT/UTC, not compared to local time.
The enddate value is NOT included in the count. If you want it included, you must specify the following date. In other words, if you have a deadline of March 31, 2015 for submissions and that day is still a valid submission day, the you must code enddate as the following day, i.e. April 1, 2015.
In Tiki9 this plugin has been fixed and improved:
- select the correct time zone
- add ability to show years and months;
- cover entire time period regardless of time units shown;
- ability to show calendar day difference (eg tomorrow is 1 day away even if less than 24 hours away);
- allow custom text;
- ability to set thousands separator;
- time string punctuation and singular vs plural fixed
Table of contents
Usage and Parameters
To use this plugin in a wiki page, use the syntax:Syntax for COUNTDOWN plugin
{COUNTDOWN(enddate=>April 1 2020)}countdown message{COUNTDOWN}| Parameter | Accepted values | Default | Effect | Required? | Since |
|---|---|---|---|---|---|
| enddate | Dates in multiple formats: Apr(il) 1 2020, 1 Apr(il) 2020, Apr-01-2020, 01-Apr-2020, 01-04-2020, 04/01/2020 | none | Displays number of days, hours, minutes and seconds until the enddate | y | |
| locatetime | on or off | on | if set to off, shows date only (no time fields displayed) | optional | ? |
| show | d=days, h=hours, m=minutes, s=seconds. Enter multiple values as: dh or dhm or dhms. | dhms, unless locatetime=off specified, in which case no time components are shown | specify which time components to be shown | optional | ? |
| since | y or n | y (v.6) n (v.4) | whether to also provide countdown if enddate is in the past | If set to y and value of enddate is in the past plugin returns days (and if asked, time) SINCE the date. If set to n and the value of enddate is in the past, the value returned will simply be the text string countdown message followed by the text string is over. | ? |
| countdown message (text between the COUNTDOWN tags) | string | none | Appends a text message to the end of the countdown | n |
Examples
1. This code,{COUNTDOWN(enddate=>01-Apr-2020)} __the project is done!__ {COUNTDOWN} |
|
Would produce: 2867 days, 22 hours, 28 minutes, 1 seconds, until the project is done! |
2. This code,{COUNTDOWN(enddate=>01-Apr-2010)} __the project start date__ {COUNTDOWN} |
|
Would produce: 785 days, 1 hours, 31 minutes, 58 seconds, since the project start date. |
3. This code,{COUNTDOWN(enddate=>01-Apr-2010,show=dhm)} __the project start date__ {COUNTDOWN} |
|
Would produce: 785 days, 1 hours, 31 minutes, since the project start date. |
4. This code,{COUNTDOWN(enddate=>01-Apr-2010,show=d)} __the project start date__ {COUNTDOWN} |
|
Would produce: 785 days, since the project start date. |
5. This code is a variant of the previous{COUNTDOWN(enddate=>01-Apr-2010,locatetime=off)} __the project start date__ {COUNTDOWN} |
|
and would thus produce the same result as the previous example 785 days, since the project start date. |
6. while this code,{COUNTDOWN(enddate=>01-Apr-2010,since=n)} __the project start date {COUNTDOWN}__ |
|
should produce: the project start date is over but doesn't, showing instead: <-- i.e. nothing at all! The software used by doc.tiki.org needs to be fixed. A correction is being submitted. |
7. instead, this code,{COUNTDOWN(enddate=>01-Apr-2010,since=y)} __the project start date__ {COUNTDOWN}__ |
|
produces: 785 days, 1 hours, 31 minutes, 58 seconds, since the project start date the project start date is over In other words, it shows the formatted "text" (in this case in bold), then repeats it, followed by the text string " is over" (unformatted). |
