Forum Academy Marketplace Showcase Pricing Features

How to constrain only by date, not date and time?

I am trying to display a repeating group of bookings by a type, as well as by the DATE of the booking by using a “Date Picker”

The problem is, the Booking Date in the database can only be set up as Date AND Time. I can’t see an option for just “Date” so when I try to filter the list of bookings by date with a date picker, it doesn’t show them.

If I change the date picker to be Date and Time and choose the correct time of one of the bookings, it will show the booking - but I don’t want that. I want to see ALL the bookings for the whole date, not a specific date AND time.

Is there a way to do this that I am missing?

Option A) Create a text field, and when you store the date, use the datepicker’s value:formatted as and select a format with only date. Filter using this text field ( the date picker’s value:formatted as again)

Option B) Filter twice the date: 1 - Date field > datepicker’s value:set sec 0:set min 0:set hours: 0 and 2- Date field < datepicker’s value:set sec 59:set min 59:set hours: 23

I’m not really sure I’m following what you’re saying…but

Attempting to store the date for "Booking Date’ from a “formatted as” (date only) text field does not save the date correctly. It seems to add some arbitrary hour value once put in the database. Apparently, in the database it MUST be in format mm:dd:yyyy hh:mm am/pm which is very frustrating.

As for Option B I really don’t understand it…

If you store in a text field, you can format is as you want. So you can exclude the time
All of what I say are function that you have when you click “more” after the date value from date picker
option C, if you wan’t to continue to use date field, is to set the date and TIME. Date picker basically use the date selected + current time. But you can force bubble to set 00:00:00. Again, this function come after date picker’value by clicking more and you use :set hour 0:set min 0:set sec 0

@tonymoulatsiotis I made an example page for you to see what you can do based on what @Jici suggested. Basically, when you input the bookings into the Booking Date as a formatted date you force Bubble to save it with the time 00:00:00, then you can filter your repeating group to use a Date Picker that is looking for a record from that date with the same time of 00:00:00.

In my example, when you create a new record using the button Add Booking, the workflow sets the date to be the date you selected, and then saves it with the time as 00:00:00 instead of the current time. All your bookings will be saved as the time being 00:00:00. Then the search Date Picker that is being used to filter the repeating group uses the date set in the Search Date Picker, but also forces it to use 00:00:00 so that you can get a match.

Testing-ground-cm | Bubble Editor

Go to Preview and add some new records with whatever date you want and then use the Search Date Picker and you’ll see them show up.

1 Like

I don’t want it to save as time 00:00

Bookings will have a date and time, so I need to store it as date and time, but I want to be able to show all the bookings on a single date…excluding a time check. I want it to show all the bookings in like a timeslot fashion…so like each day will be split up into 30 minute timeslots.

When I choose say June 12 in the date picker, it will show all bookings for June 12, but within that repeating group will be another repeating group of timeslot constrained to bookings associated to that timeslot…which is also a head scratcher on how to set up.

Maybe I can get it to store the date from the date picker just as “text” in the database instead of “date.” For example when I create a booking, it will make the booking date the actual date and time specified by the user making the booking, but it will also, behind the scenes, take just the date and enter it in for that entry, then when I want to show all bookings with that date I will get it to check the “text” date field, not the date, date field…

I will check your example page but will also have to mess around myself. Thanks

Have you tried using a calendar plugin yet? They make it pretty easy to display events on any given day and display them in chronological order with appropriate chronological placement.