Realtime update

i still have not found to to transform the resulted seconds to HH:MM:SS. I think there is a formula for that but i could not find it. @ahaller07 (AirDev) team has made a project which contained this countdown. Maybe they can solve the mistery :slight_smile:

I found it!!!
http://bidy.dk/version-test/auction - please see

2 Likes

Glad you made it work @cm1! To turn a number of seconds into HH:MM:SS, you need to write each component separately. Each one starts with the same [end time] - [current time], but then you can turn that into hours, minutes, and seconds respectively. The key is that for each component, you want to round down rather than rounding to the nearest 1. There is no rounddown feature, but if you subtract .5 from the number and then round, it is the same as rounding down.

1 Like

Yes I started to write all that out and realised it got quite complex as you need to remove the higher units.

But it means you can format it in lots of ways. It is just fiddly.

If I was being lazy I would just iFrame a countdown in.

i found a much simple way. i ll update the public app soon so you can check out. no need to do anything extra, just use module option (no clue what that means :D)

1 Like

my way was not precise enough. i m trying your way now but is not 100% clear to me.
Substract .5 from then number and then round to?

regards Claudiu

i think this way would be better. Because right now, if a user performs multiple actions on this popup, the countdown stops. How would you iframe it?

Subtract 0.5 from the number and then round to the nearest 1; should be the same as rounding down:

If you start with 1.7, then 1.2 rounded is 1
If you start with 1.2, then 0.7 rounded is 1
If you start with 1, then 0.5 rounded is 1

You should be able to create a timed workflow that updates a custom state every 1 second, where the custom state is a field of type = date, and the workflow makes it = to the current date/time. This shouldn’t be disrupted by other workflows.

For example, i have the value in seconds wich is 3600 (1 hour left)
What i need is, this number max value to be 59 and, when it goes to 0, the number should start again from 59 and countdown as long as the whole number value is > 59. (the last field in the website contains raw seconds left)
Also, if my user bids multiple times, the seconds are stopping for some reasons:
http://bidy.dk/version-test/mobile-auction. Try to click multiple times on the yellow button
It does not affect the timer if somebody else is biding from other computer. It s only for the current user

Hi Nigel

Could you maybe iFrame the cound down here?
https://bubble.io/page?type=page&name=auction&id=bidy-public&tab=tabs-1. The timer is located in ā€œpopup-ad_detailsā€ - ā€œgroup-time_leftā€
The flow i have right now is not good enough, as the timer stops when other operations are performed.
Maybe the iFrame solution would work.

I looked at @NigelG’s timer and I’m running into a weird issue – If I set a timer and then change the time on my computer (e.g., change it from 10:45pm to 10:35pm) then the amount of time remaining in the countdown changes as well (even after it’s been set). However, if I move my clock forward (e.g., from 10:45pm to 10:55pm) then the counter remains the same. I’m running into the same challenge in our app in that the ā€œcurrent data/timeā€ seems to be based on the current users computer and they can move their clock to change it.

Does anyone know any workarounds to make the current date/time the real current date/time (irregarless of a user’s computer’s time)?

UPDATE – I discovered that if I refresh the page that the time remaining goes back to the original amount. And, after playing with it some more, I’ve come to the conclusion that as long as users don’t play with their own clock to game the system that the timing should work.

i think we have discussed that in another topic, that Bubbles current date is based on server date.

The clock on your computer only counts fractions of seconds, which is how it can be set manually.
On page load, grab the current time and set each countdown accordingly, then no matter what time the computer thinks it is, you’re only counting seconds.

No need to use popup if you set a state at the page level.

If this genius-user changed the clock on the computer said genius would just have incorrect information on the auction. They would never win.

But, in theory, you could check the location and the time on page load to see if they match. Then search your db for lastname=einsterin because he figured it out. :wink:

https://www.programmableweb.com/api/earthtools