ā¦and so, anticipating the need for a ātime pickerā myself, I set out to create one using only Bubble - i.e. no plug-ins, CSS, or JS hacks.
I actually had everything working using Bubble Dropdown elements but discovered rendering inconsistencies across devices and browsers. I then redesigned it using a single RG for choosing the time components (instead of multiple Dropdown elements). It now renders and operates consistently across all devices tested, including Android, iOS, and all major browsers (thanks to Bubbleās pixel-perfect layout engine).
I implemented it as a reusable element using just a few (8 to be exact) elementsā¦
The lists of hours and minutes are generated dynamically āon the flyā.
Configurable minute āstepsā (intervals).
Configurable foreground and background colors.
Does not use the DB or Options Sets and is dynamic and configurable.
It can be seen in action on the demo page below. The date picker is a regular Bubble Date/Time Picker element, but the time picker is my ācustomā (reusable) element. Check itā¦
@boston85719 and @ben4, I plan to make the details available. Stay tuned.
BTW, while the approach is conceptually straightforward, it was more challenging to implement than I anticipated due to the logic required to support both 24-hour and 12-hour format as well as dealing with some Bubble formatting deficiencies.
For instance, to get leading zeros, I divided the number by 100, formatted to 2 decimal places and then simply grabbed the last 2 charactersā¦
If more leading zeros are needed, just divide by larger power of 10. Itās a handy technique, but it would be unnecessary with better formatting options in Bubble.
I LOVE this implementation. Buttery smooth on mobile, too!
I despise the default drop down menu for selecting time in Bubble. I will be studying this post intensely in the near future to imitate it because the way you designed this time picker solves some major user interface issues Iāve been dealing with in my app. Thank you so much for the inspiration!
Iām actually working on an app that uses time and scheduling and this motivated me to make something without a plugin. Havenāt worked it into a reusable element and 24 hour clock yet, but itās going pretty smooth