Is it possible to subtract the Date time range from another?
For example, I’ve a date range like this
[“Nov 30, 2023 10:30 am”,“Nov 30, 2023 14:00 pm”]
Can we subtract another date range like [“Nov 30, 2023 11:30 am”,“Nov 30, 2023 12:00 pm”] from the above range
&
Generate two time ranges like this
[“Nov 30, 2023 10:30 am”,“Nov 30, 2023 11:30 pm”] and
[“Nov 30, 2023 12:30 am”,“Nov 30, 2023 14:00 pm”]
Using a custom javascript function would work quite well here, as this would probably be just a few lines of code.
But you can also set this up with native bubble with a few workflow steps.
Is it guaranteed that Date Range B is always fully contained by Date Range A? Or could it be partially contained? Or could it also be fully outside?
If the latter two scenarios are allowed, what would you want your output to look like?
If I understand correctly, you have two date ranges - one of which is entirely contained within the other - and you want to effectively “remove” the contained date range from the containing date range, thereby resulting in two new date ranges.
For the specific scenario you describe, you’d simply create two new ranges as follows:
First range would be containing_range:start <- range -> contained_range:start
Second range would be contained_range:end <- range -> containing_range:end
You’d probably want to first check to ensure one range is entirely contained within the other. Bubble has lots of super handy and efficient date related operations.