Loading...
 

Greffon Countdown

Ce greffon Wiki affiche un compte-à-rebours pour une date future depuis une date dans le passé, ainsi qu'un texte par défaut ou personnalisé, le cas échéant.

Voir également : PluginCountup

Paramètres

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

Exemples

1. Ce code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2020")} le projet est terminé !__ {COUNTDOWN}

arrow-right.png
Produira :
le projet est terminé ! is over
2. Ce code,
Copy to clipboard
{COUNTDOWN(enddate="2020-03-05T22:00" show="m")} __le projet est terminé !__ {COUNTDOWN}

arrow-right.png
Produira :
le projet est terminé ! is over
3. Ce code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2020" caldays="y" show="yod")} __le projet est terminé !__ {COUNTDOWN}

arrow-right.png
Produira :
le projet est terminé ! is over
 Note pour l'exemple ci-dessus
Utiliser caldays pour compter les jours du calendrier même s'il s'agit de moins de 24 heures

4. Ce 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")} __la date de démarrage du projet__ {COUNTDOWN}

arrow-right.png
Produira :
la date de démarrage du projet has passed
 Note pour l'exemple ci-dessus
Affiche un texte personnalisé au lieu du temps écoulé pour une date passée.

5. Ce code,
Copy to clipboard
{COUNTDOWN(enddate="01-Apr-2010" since="y" show="yodhms")} __la date de démarrage du projet__ {COUNTDOWN}

arrow-right.png
Produira :
14 years, 15 days, 11 hours, 15 minutes and 52 seconds since la date de démarrage du projet
 Note pour l'exemple ci-dessus
Afficher le temps écoulé depuis une date passée à la seconde près


Si vous souhaitez rafraîchir automatiquement la page toutes les 60 secondes, vous pouvez utiliser ce code :

Copy to clipboard
{HTML()}{HTML}


ou utiliser un module JavaScript ou jQuery pour réaliser cette opération, ou peut-être un appel Ajax pour le module ..... Si vous trouvez une meilleure méthode que celle décrite ci-dessus, n'hésitez pas à la documenter ici.

List Slides