Warning: Undefined variable $filepath in /home/tiki-doc/public_html/lib/wiki-plugins/wikiplugin_tikidocfromcode.php on line 146
Display the time until or after a date and time | Documentation for Tiki Wiki CMS Groupware
Loading...
 
Skip to main content
Display the time until or after a date and time

Plugin Countdown

This wiki plugin displays a countdown to a future date from a date in the past, together with default or custom text if desired.

See also: PluginCountup

Parameters

Tiki Doc From Code error: countdown not found

Examples

1. This code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2020")} __the project is done!__ {COUNTDOWN}

arrow-right.png
Would produce:
the project is done! is over
2. This code,
Copy to clipboard
{COUNTDOWN(enddate="2020-03-05T22:00" show="m")} __the project is done!__ {COUNTDOWN}

arrow-right.png
Would produce:
the project is done! is over
3. This code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2020" caldays="y" show="yod")} __the project is done!__ {COUNTDOWN}

arrow-right.png
Would produce:
the project is done! is over
 Note for above example
Uses caldays to count calendar days even if less than 24 hours away

4. This code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2010" since="n" text="before|is happening in less than a month|after|happened way less than a month ago|has passed")} __the project start date__ {COUNTDOWN}

arrow-right.png
Would produce:
the project start date has passed
 Note for above example
Show custom text instead of time elapsed for a date in the past.

5. This code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2010" since="y" show="yodhms")} __the project start date__ {COUNTDOWN}

arrow-right.png
Would produce:
14 years, 11 months, 2 days, 12 hours, 36 minutes and 30 seconds since the project start date
 Note for above example
Show time elapsed since a date in the past down to the second


If you want to automatically refresh the page every 60 seconds you could either use this code:

Copy to clipboard
{HTML()}<meta http-equiv="refresh" content="60">{HTML}


or get a JavaScript or jQuery plugin to get this done, maybe an Ajax call for the plugin .... if you find a better method than above, please feel free to document here.


Created by lindon. Last Modification: Tuesday 14 June, 2022 21:40:39 GMT-0000 by Marc Laporte.
Show PHP error messages