List or range of dates: how to split into individual records?

Hi folks, I am challenged by the following task.
Context
My app is the booking engine. I am creating an interface for hosts, and I want to enable them to easily pick dates (not necessarily individual dates) when they are not available. Such dates then would be excluded from proposed booking dates for their customers.

As a date input tool I am using Air Date/Time picker (Air Date/Time Picker Plugin | Bubble). It allows picking single dates and date ranges OR multi-date selector.

Challenge
Now, when host would use date range or multi-date selectors, those are to be saved into database as, respectively, date ranges, or date lists - that’s how Air Date/Time picker works with batch selections of dates.

For example:
Date range: 01/10/2021 - 31/10/2021
Date list: 01/10/2021, 15/10/2021, 31/10/2021

However, for some further use cases, those formats are not very convenient, and I would like to be able to split those by days.
Examples

  1. I would like to split date list into individual dates (and be able to store them in DB or use on UI statically), like:
    Date list 01/10/2021, 15/10/2021, 31/10/2021 should become
    Date 01/10/2021
    Date 15/10/2021
    Date 31/10/2021

  2. Similarly, I would like to extract dates that comprise the date range 01/10/2021 - 31/10/2021, i.e. obtain separate 31 records that I could then re-save, for example.

Is there a way of achieving this?
Thank you :slight_smile:

The plugin calendar tools will help you make a daily date record.

I have a plugin designed for this specific use case. Check it out here

Learn More

I am Jared. Your friendly NoCode consultant. We will work together to achieve your vision! Book some time today!

Thanks, Jared,
I’ve checked the Calendar Tools plug in, but it appears to just return a grid with dates + drilldown into specific times for bookings. What I am looking is more around data transformation approach.

did you check out the linkn i shared? that may be more your speed?

Yup, I did, - your plugin appears to be nice, however I am interested if there is a technical “native” solution to data conversion. All in all, that would be useful for me further on, cause pulling apart (splitting) the arrays/ranges into individual section comes helpful for the UX works.

In any case I am working with an unpaid version of Bubble.io for this project so I can’t yet get plugins… :slight_smile:

I think you can definitely accomplish this natively but it may require backend workflows. You got this!

You can but not on a recurring subscription. You’d have to purchase them or build it yourself. Again, you got this!

Haha, so still open, - wondering how to achieve this :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.