Loading...
 
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

Display the time until or after a date and time
Introduced in Tiki 1. Required parameters are in bold.
Go to the source code
Preferences required: wikiplugin_countdown

Parameters Accepted Values Description Default Since
(body of plugin) Text to append to the countdown.
enddate datetime Target date and time. Multiple formats accepted. 1
caldays (blank)
y
n
Will use calendar day difference when set to Yes (y) and time units are not shown. Result is that tomorrow, for example, is always shown as a one day away even if less than 24 hours from now. No (n) is the default. n 9.0
since (blank)
y
n
If Yes (y), will display amount of time since the event (default). If No (n) and if there is body text, will display "is over" or custom text set in text parameter after body text. 4.2
show (blank)| y| yo| yod| yodh| yodhm| yodhms| o| od| odh| odhm| odhms| d| dh| dhm| dhms| h| hm| hms| m| ms| s Select: y=years, o=months, d=days, h=hours, m=minutes, s=seconds. Enter multiple values as: yodhms. Must be in the order of descending length, and a time unit should not be skipped. If blank, the time is shown down to the hour if not zero. 4.2
text default, silent, custom: before event|after event|after event when time not shown Text that will show with the countdown and body text. Set to default or leave empty to show "xxx days until/since body text", except that if the since parameter is set to No (n), "body text is over" will show after the end date has passed. Also, if no time is shown because of the time units being displayed (for example, only years are shown and it's less than a year before/after the end date) then "body text will happen in less than a year/happened in the last year" will show. Or set pipe-separated custom text as follows: before date|before date by less than shortest time unit shown|after date |after date by less than shortest time unit shown|after date and since set to No (n). Set to silent for no text. 9.0
thousands (blank)
c
p
s
Set the thousands separator for results of 1,000 or more. Choices are comma (c), decimal (d), space (s), or leave blank for no separator. 9.0

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:
13 years, 11 months, 18 days, 5 hours, 28 minutes and 57 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.

doc.tiki.org

Get Started

Admin Guide User Guide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting
Articles and Submissions
Backlinks
Banners
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution
Cookie
Copyright
Credit
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
Draw
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Mail-in
Map with Mapserver
Menu
Meta Elements
Mobile Tiki and Voice Tiki
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags
Task
Tell a Friend, alert + Social Bookmarking
TikiTests
Theme CSS & Smarty
Tiki Manager
Trackers
Transitions
User Administration including registration and banning
User Files
User Menu
Watch
WebDAV
Webmail
Web Services
Wiki History, page rename, etc
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG
XMLRPC

Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki