How do I create a time without the date

What’s the best way to allow people to create a start and finish time without the date?

I’m trying to allow people to select a start and end time for a repeating task. Having them select the date would be confusing since the task will be done daily.

I have a group covering the date selector section of the date/time picker so that only the time selector section is visible. But the time doesn’t save to the database unless the date is selected. I’m trying to figure out how to allow them to only select the time and then change the date to the current date.

I tried extracting the current date using this but it’s not working…

You would want to use number fields instead with inputs set to Integer. And your conditionals would check if the Current Date/time different components line up with your number values. So you would extract the hour from the current time, and also extract the minutes from the current time, and if that = the current date/times values then you make it do what you want.

Ok just so I’m clear, I add remove the date/time picker all together and use a regular input that is set to integer, change the data type from date to a number?

Then how do I convert the number they enter into the input to a time? I just need to create a custom event that triggers a workflow everyday at that time they’ve created

The short answer to your original question is… you don’t. The date object describes a unique point in time. Dates ARE times. There is no date without a time. There is no point-in-time without a date.

Based on more recent changes to Bubble, SOME of the info in the following video is out-of-date (see what I did there?) but much of it is foundational on understanding dates. See:

1 Like

Yeah I guess i could have framed the question in a better way.

I understand that a time needs a date. I’m trying to save a unique point in time so that I can set a reoccurring workflow that gets triggered every day at that time. Rather than once on a specific date

You could use the date picker like you had it, but schedule a workflow instead to the date picker’s value + 1 day. Then have it reschedule it self indefinitely + 1 day everytime?

Be careful of infinite loops though, will need a way to cancel/break the cycle

1 Like

That is a solid idea. The problem I’m running into however is creating the time without actually having the user enter a date. The form will look like this…

“When will this task be completed?”
Option set: daily, weekly, monthly

“Enter the time of day you intend to complete this task”
“input”

I’m trying to figure out how to create a time with an integer input instead of a date/time picker

1 Like

Just use a dropdown (or 2), either with some option sets or just a list of numbers…

What would the constraint be to let bubble know that the number is a time so I can have that time trigger a reoccurring workflow?

Just use the number(s) to define the hours/minutes…

Right but what’s the equation to do that? If the data type is a date and the input is an integer, then what do I add to this define the numbers as a time?

If the data type is a date and the input is an integer, then what do I add to this define the numbers as a time?

A time without a date is not a Date (in the Bubble sense)… it’s just 2 numbers (a number of hours and a number of minutes)…

So, although I’m not entirely sure what you’re trying to do in your workflow, you probably don’t want to be storing those as ‘Dates’ at all (they are not dates), so just store the hours and minutes as numbers (i.e. ‘start time hours’, ‘start time minutes’ etc.). Or you could store it as a decimal (i.e. start time 10.5 for 10:30am)…

If/when it comes to actually using a Date value based on the ‘Time’ (the hours and minutes), then you’ll first need to define some actual Date (such as today’s date, or some arbitrary date), and then just change the hours and minutes to the saved values.

For example, if using separate Number values for the hours and minutes, and you want the recurring activity to start today, use Current Date/time: change hours to (the saved hour value, or input value): change minutes to (the saved minute value, or input value)

If using a decimal for the ‘times’ (such as 10.5 for 10:30am) use Current Date/time: rounded down to Day: plus hours (the saved start time number)

1 Like

That helps a ton! Thank you for breaking it down