Air Date / Time Picker for time exclusively (without date)

Hi all,

for my application Aventurista.es, I am using Air Date / Time Picker to pick up user input for events they are creating, and for them to include in the event information, which date / time the event takes place.
For now, the user is only giving the information, which day the event takes place, but now I would like to make an add-on about additional start and end dates of the event.
To keep things simple, I created a field each for the start and end time, by making use of Air Date / Time Picker, where I enable the option to only pick the time. I know that I could have this easier by using “picker” and define “day and time”, but for practicality I need to have “date” and “time” in different entries in the DB.

Now my question: Are you aware of any method, how I can store the “time” information I collected via Air Date / Time picker in the database WITHOUT any associated date? So far, the plugin let´s me only request the time via the interface, but when I look into the db, it always stored the time information with a date.

Thank you :slight_smile:

In this case, instead of saving the information as a date, you have to save it as a number.

You can use :extract on the date to save the hours, minutes.

1 Like

Thanks Alexander for your very quick response. I am currently saving it as text in the db, but the tool itself is always including the full string. I guess the :extract option also works for text, otherwise I will change the field type to be a number.
Will try straight away :slight_smile:

No problem, but I would recommend to save it as a number, because in this way you can later use it to set a date to this time if needed (with the “change hours to” or “+(hours)”.

2 Likes

I just put together a sample app of a simple time picker…it has buttons to allow users to add 15 minute increments or 1 hour increments…it is currently set to be 2 hours ahead of current time on page load, however that is just set using a default value on a custom state.

Its using custom states set on the page itself. It has workflows to set the custom states on page load. It also has button workflows to increase the time choice. There is no reason somebody couldn’t tweak it for their own purposes to subtract time as well.

Look for custom states on page, conditionals on elements for display purposes…specifically it is on the minute text display…bubble won’t let you display zero as a double zero for minutes display, so when the custom state of minutes is at zero the text element is set to display 00 as a text.

Hope it helps others…

To save the time picked just do workflows to save the custom state value or make the text elements into input elements and save the inputs current value.

https://bubble.io/page?name=index&id=timepickerboston85719&tab=tabs-1