AirDate/TimePicker : Current Date and Rounding to Quarter Hours?

Hi All,

I figure that there must be an easy solution to this but I cannot figure it out.

I want to set initial date to a stored value in the database so that the form can be updated.

BUT the first time sees the airdate/timepicker and before they click on it, they should see no value.

AND - the first view of the calendar WHEN IT POPS OPEN is the current date BUT the minutes rounded to the closest quarter hour.

Eg. if it is 8:39 I want to AirDate/TimePicker to show 8:45…that way if they don’t change the time, it will not be storing a date 8:39…

I have set up the element to only accept 15 min segments so if they actually move the minute slider, it takes them to the next quarter hour, but the first minute value that the user is offered is the 39 minute value or 12 like the image below.

Can Anyone help me with this?

1 Like

Hello @kevin.hunt ,

Hope you’re doing well.

Indeed, performing mathematical operations with basic Bubble functionalities might be a little bit tricky, but it is totally possible to achieve your desired output where the minutes will be rounded to the nearest quarter hour.

For example, you can first extract the minutes from the date as a number:

Then apply the formula that will give you the rounded number to the closest quarter hour:

Finally, in the Air Picker element, simply change the minutes to the result you got:

You can see how this all works yourself on this test page: Seanhootsdemopro | Bubble Editor

Please check it on your end and let us know if everything is clear or if you have any other questions. :pray:

Thanks, and we look forward to your reply.

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

thanks - this works great!

1 Like

Hello @kevin.hunt,

Thank you for your confirmation.

It’s great to hear that the solution has worked well for you. Please feel free to reach out if you have any plugin-related questions; it’s always our pleasure to help you out.

By the way, if you find our plugin and support helpful, we’d really appreciate it if you could take a moment to leave a review. Simply go to the Plugins tab in the Bubble editor, search for the plugin by name, and award it the stars you think it deserves. Your support would mean a great deal to us!

Furthermore, if you would like to share your complete experience with Zeroqode, we would be grateful if you could leave your feedback at: Review.

Also, you can use the direct links:

Your feedback is extremely valuable to both us and the Bubble community, inspiring us to keep delivering top-notch products and excellent service. :blush:

Thank you again, and I wish you an amazing week ahead. :pray:

Best wishes,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3