History: PluginCountdown
Source of version: 58 (current)
Copy to clipboard
{syntax type="markdown" editor="wysiwyg"} # 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 {pluginmanager plugin="countdown"} ## Examples {SPLIT(colsize=>200|50|350)} *1. This code,* {CODE(colors="tiki")}{COUNTDOWN(enddate="01-Apr-2020")} __the project is done!__ {COUNTDOWN}{CODE} --- {ATTACH(page=>Module and Plugin Includes,file=>arrow-right.png, image=>1)}{ATTACH} --- *Would produce:* {COUNTDOWN(enddate="01-Apr-2020")} **the project is done!** {COUNTDOWN} @@@ *2. This code,* {CODE(colors="tiki")}{COUNTDOWN(enddate="2020-03-05T22:00" show="m")} __the project is done!__ {COUNTDOWN}{CODE} --- {ATTACH(page=>Module and Plugin Includes,file=>arrow-right.png, image=>1)}{ATTACH} --- *Would produce:* {COUNTDOWN(enddate="2020-03-05T22:00" show="yodhms")} **the project is done!** {COUNTDOWN} @@@ *3. This code,* {CODE(colors="tiki")}{COUNTDOWN(enddate="01-Apr-2020" caldays="y" show="yod")} __the project is done!__ {COUNTDOWN}{CODE} --- {ATTACH(page=>Module and Plugin Includes,file=>arrow-right.png, image=>1)}{ATTACH} --- *Would produce:* {COUNTDOWN(enddate="01-Apr-2020" caldays="y" show="yod")} **the project is done!** {COUNTDOWN} @@@ {REMARKSBOX(type="tip" title="Note for above example")}*Uses `caldays` to count calendar days even if less than 24 hours away*{REMARKSBOX} @@@ *4. This code,* {CODE(colors="tiki")}{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}{CODE} --- {ATTACH(page=>Module and Plugin Includes,file=>arrow-right.png, image=>1)}{ATTACH} --- *Would produce:* {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} @@@ {REMARKSBOX(type="tip" title="Note for above example")}*Show custom text instead of time elapsed for a date in the past.*{REMARKSBOX} @@@ *5. This code,* {CODE(colors="tiki")}{COUNTDOWN(enddate="01-Apr-2010" since="y" show="yodhms")} __the project start date__ {COUNTDOWN}{CODE} --- {ATTACH(page=>Module and Plugin Includes,file=>arrow-right.png, image=>1)}{ATTACH} --- *Would produce:* {COUNTDOWN(enddate="01-Apr-2010" since="y" show="yodhms")} **the project start date** {COUNTDOWN} @@@ {REMARKSBOX(type="tip" title="Note for above example")}*Show time elapsed since a date in the past down to the second*{REMARKSBOX} {SPLIT} If you want to automatically refresh the page every 60 seconds you could either use this code: {CODE(colors="tiki")}{HTML()}<meta http-equiv="refresh" content="60">{HTML}{CODE} 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.