Using current time and future time as range for slider input

Hi everyone,

So what I’m trying to implement is adding a slider input bar at the bottom of the screen that shows time. The idea is that the minimum value of the bar would be the current or real time, depending on the user’s time zone. Then the maximum value would be a bar that would be 24 hours ahead of the minimum value. This would affect what markers would appear on the map, making some appear or disappear depending on the time. However, bubble doesn’t let me do this because the slider input only allows numeric values to be selected, whereas time is treated as text. What would be the best way to proceed about this? Thanks in advance!

1 Like

Great question! I am having the same issue myself with a startup. Anyone have any guidance on this?

Hi @derek.phavorachit @jesusbadillo11

Hopefully you gents have found a solution for this by now. I’ve also encountered a similar issue in wanting to use a slider to reflect current and future time based on user interaction. Here is a summary of my explorations and current solution.

Explorations
1- Changing/storing date to Jan 1, 1970 12:00 AM [Change Year, Month, Day to 1, Hours, Min, Sec to 0 +(seconds)] to power slider
2 - Using Mathjs API to save date in Unix to power slider
3 - Using UNIX Converter to change/store date to power slider
4 - Using a drop-down input to display future date/time options
5- Converting slider integers into hours to power marker

Current Solution
Using “Slider integers” to power a displayed date view, where each integer represent +hours + present time.

Slider Input
Min = 0 [This represent present time]
Max = current time, +hours:24, :format as hours [Max integer will be 24 hours into the future]
Steps = 1 [This # controls the value of each slider step]

Displayed Marker
current time, +hours:, slider value

Undisturbed, the marker will display the current time in the users time zone. Each slider input will add another hour to the current date with a max of 24 hours.

Please let me know if this helps or if you’ve discovered a better solution.

1 Like

Hi @howcrio

Thanks so much for the help! I was actually approaching it this way, but I’m still sort of new to bubble. I think I just need some more time to understand how everything works. Thanks again!

No problem. This is what the Bubble community is for.

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