countdown timer

25 views
Skip to first unread message

Graham Wood

unread,
Jan 29, 2023, 6:43:38 PMJan 29
to mementodatabase
Im trying to setup a countdown timer and it counts down ok but after the date is expired it keeps counting. What do I need to add to stop it counting back up again
I have the following in a calculation field, 

datediff(#{startdate},now())
Message has been deleted
Message has been deleted

Graham Wood

unread,
Jan 29, 2023, 10:52:40 PMJan 29
to mementodatabase
After posting this I got it all working as I wanted it to.
If anyone has another way to do it I would love to see the solution. Here is mine

My calculation field (Countdown) is this and it gives a negative number (set to Integer)

if(#{startdate}!=0,ceil((#{startdate}-now())/86400),0)

then in a javascript field (Days to Go) I have this

if (field("Countdown")<="0")'0 Days\nHappy Holidays';

else if (field("Countdown") =="1") '1 Day to go';

else field("Countdown") +' Days to go'



Er Mo

unread,
Jan 30, 2023, 11:36:19 AMJan 30
to mementodatabase
Hallo
Da fällt mir spontan ein ,das man das Feld Unsichtbar machen könnte . So würde der Coundown nur angezeigt wenn er Läuft .

Hi
It occurs to me spontaneously that you could make the field invisible. So the countdown would only show up when it's running.

Ernst

Graham Wood

unread,
Jan 30, 2023, 10:03:56 PMJan 30
to mementodatabase
Ernst,

thats exactly as I have it, the countdown field is invisible and the  javascript field displays the countdown, see my attached image and when it gets to 0 you dont see the countdown going anymore

Screenshot.jpg
Reply all
Reply to author
Forward
0 new messages