Hi, is there a way I can build an alarm clock on Glide? That sets off after a particular time every day?
Hi,
Did you explore the “stopwatch” component?
You may be interested by
Hi, no, I did check out the stopwatch component. But I am unable to build a countdown timer with it. Any leads?
Tried this, but my timer doesn’t count down, nor does it take the duration into account.
I’m stuck!
Here’s what I have -
Start time - now()
Duration - 0.15
I give these two values in the stopwatch elements, but the clock keeps going on even after 15 minutes.
Help please!
I think you’re trying to put a square peg in a round hole, here.
The stop watch counts up, not down. I don’t think it’s possible to use it like an alarm clock.
In fact, I don’t think it’s possible to build alarm clock type functionality with Glide right now.
Although Glide can trigger sounds, that can only be done with an action - so it requires that the user tap a button or some other component. There is currently no way in Glide to trigger actions based on time.
Also the start time and duration are meant to be set by the stopwatch buttons. Not by you. They are there to track when and which buttons you pressed so it can function properly. The start time tracks when the start button was pressed. The duration tracks how much time elapsed when you pressed pause. If you press play after a pause, then glide does some internal math to add the current duration between now and the start time, added to the existing duration. It’s all to make the stopwatch function normally and allow you to switch screens while allowing the stopwatch to still function. If you press the stop button, it clears out both fields so it’s ready to start fresh and fill with a new start time when you press play/start. The whole point of those two fields is so the javascript knows what to display on the stopwatch using some math.
Okay…is there a way I can build a countdown timer at all on Glide then?
If it doesn’t need to be exactly precise and you are ok with it updating every 5 to 10 seconds, then yes you can. All you need is a some math to get get the duration between now and a future date/time. Then convert it to whichever format you want since date math gives you a duration in days.
Just noticed you asked the same question in another thread. Rather than making things more confusing and having multiple threads on the same question, I’ll refer to the other thread and let’s continue there. Looks like you already got an answer there.
Yes, I did get a solution in that thread. Thanks for your time and guidance, I’ll try it out