Progress of Date Range

Hey everyone!

I’ve gotten stuck on a specific problem and would love some help!

I’m looking to use the progress bar to show the progress between a start date and an end date, relative to the current date.

image

Ideally it will look like this and progress until becoming full when the date is dec 4.

I can’t figure out how to dynamically calculate the percentage. I should also add the data is just set up as “Start date” which is of type date, and “End date” which is of type date.

Any help is greatly appreciated!

Thanks!
Cal

Hey @calmorrison99,

Here’s how I’d dynamically calculate the percentage:

  1. Anywhere you want, like maybe in a hidden popup, create a few new groups of type number
  2. Make the data source for the first one (Group TotalTime): Date2 - Date1:format as seconds
  3. Make the data source for the second one (Group ElapsedTime): Current date/time - Date1:format as seconds
  4. Now use the following expression anywhere you need the percentage: Group ElapsedTime’s number / Group TotalTime’s number * 100 (where the *100 is optional if you need it in percent form rather than decimal form)

Hope that helps!

Kevin
AirDev

We’re looking for Bubble developers to join our team: https://jobs.airdev.co/

4 Likes

Thank you so much for your help! Works perfect!

image

This topic was automatically closed after 70 days. New replies are no longer allowed.