Creating Start Time, End Time, Start Date and End Date

Hello everyone,

I want to create a database where I can store the start date, end date, start time, and end time for an event. In bubble’s database, the only way I can store the data is as a date time object. How can I store the data for the dates and the times separately?

I’m not too sure why you’d want to do that?..

But if you really do, then just use numbers (i.e. store the year as a number, the month as a number, the date as a number, the hour as a number, and the minute as a number).

1 Like

Hi there, @omer3012345… a date field in Bubble is always a date and time, and you don’t need to store dates and times separately because you can format dates on the front end to only show the date or the time, and you can extract the different components of a date field (minute, hour, day, date, week, month, year) on the front end, too. If you really do want to store them separately, you would have to use number fields, but I definitely wouldn’t go that route.

Best…
Mike

I’m trying to create a schedule system where once the page is loaded, it will show the information regarding the events in that room.

Example:
Start Date 2/20/23
End Date 3/20/23
Event Start Time: 4:00PM
Event End Time: 5:00PM
Occurrences: Every Monday and Wednesday
Event Name: Event1
Event Room: Room1

How would you suggest creating the database with the following example? Would you suggest creating an arbitrary date and just extracting the time?

Example:
Start Date 2/20/23
End Date 3/20/23
Event Start Time: 4:00PM
Event End Time: 5:00PM
Occurrences: Every Monday and Wednesday
Event Name: Event1
Event Room: Room1

There would be nothing arbitrary about the start or end date of an event. I would have a date field for the start date/time, and I would have a date field for the end date/time. On the front end, I would format the start and end date elements to only show the date, and I would format the start and end time elements to only show the time. So, something like this…

So basically, there isn’t really way of doing “Events occur every week from 10th of September to 12th of October, and they run Monday and Tuesday from 4:00 PM to 6:00 PM.”

I would have to enter each event manually right?
Event 1 - Start: Monday May 10 2023 2pm, End: Monday May 10 2023 3pm
Event 2 - Start: Monday May 10 2023 4pm, End: Monday May 10 2023 5pm
Event 3 - Start: Monday May 10 2023 8pm, End: Monday May 10 2023 9pm

If you have a recurring event, each event in the recurrence is still its own thing in a data type, if that’s what you are asking.

Basically asking if there’s any way to reduce the need for each recurrence to be its own thing in a data type. Rather than having

Event 1 - Start: Monday May 10 2023 2pm, End: Monday May 10 2023 3pm
Event 2 - Start: Monday May 10 2023 4pm, End: Monday May 10 2023 6pm
Event 3 - Start: Tuesday May 11 2023 2pm, End: Tuesday May 11 2023 3pm
Event 4 - Start: Tuesday May 11 2023 4pm, End: Tuesday May 11 2023 6pm

Event 1 and 2 occur every Monday and Tuesday
Event 1 - Start: 2pm End: 3pm
Event 2 - Start: 4pm End: 6pm

That’s not what your original question was in this thread, but as I said, each event in the recurrence would be its own thing in a data type. Why? What if someone wants to cancel or reschedule one of the events in the recurrence? How are you going to do that if there is not a specific event to cancel or reschedule?

Apologies, I may have worded my question incorrectly at the start.

The events will not be rescheduled or changed. It’s a fixed set of events.

But even if rescheduling was required, would it not be possible to change the time from 2pm to 3pm or something like that.

If you really don’t want/need to store any information about each specific occurrence of an event, other than how often and when it occurs (although I can’t imagine too many real-world use cases for that), then just do exactly what you’ve already said…

i.e. create a single event, and store the start and end times, and the number of recurrences, and the days of the week directly on that.

To store times just use numbers (you can either use a decimal for the time - i.e. 17.5 for 5:30pm, or store the hours and minutes in separate fields).

As I said, I’m not sure how much use that would be on its own (and is certainly not the normal way to handle recurring events), but if it’s all you need, and your use-case justifies it, you can do just that.

Well, in that case, sure… do what Adam just said. I never considered that use case, though, because that’s not how recurring events work in the real world.

The events are setup for the first 6 months, and then at the end of the 6 months, new data is input for the proceeding next 6 months.

So for an event we would have

Event Name: Event1
Start Date: 10th February 2023
End End: 12th March 2023
Number of recurrences: 2 (Monday and Tuesday)
Start Time Hour: 5
Start Time Minutes: 30
End Time Hour: 6
End Time Minutes: 30

The only thing I’d like to know is how I would link the recurrences with the event.

I though you didn’t want to create recurring events? In which case what you’ve got there should work just fine.

Or, if you’re now saying that you do want to create recurring events, just have a field on the event_occurance datatype that links to the parent event datatype.

I think an image of how the data is structured might help. Here the unique item is the event venue, and the data is structured this way. When I import this bulk data into bubble.io, I want to know the best way to structure the data. The event start date and end date in conjunction with the days labelled as Yes/No create the recurring events.

I’m not entirely sure what you’re asking… but here’s how I would do it:

Day (option set)
Display
Day number (number)

Venue
Name (text)
Location (geographic address)

Event
Name (text)
Venue (Venue)

Event Occurrence
Event (Event)
Start date/time (date)
End date/time (date)