Add views filter "contains partly"

Created on 3 October 2024, 3 months ago

Problem/Motivation

A few months ago, we added views filters for "contains", "does not contain" and "starts or ends at". I just realized that we also require another one called "contains partly". Here is the use case:

In a booking system like e.g. a hotel, we have bookings with a date range, e.g. Monday 4pm until Friday 9am. With a view, we want to create a list of all bookings of today. There are 2 versions of this with a granularity of "day":

Version 1 using "contains": this creates query conditions like startdate <= 0:00 today AND enddate >= 23:59 today. That results in all bookings that contain the full day.

This is missing those bookings that either arrive or depart today, i.e. those that don't contain the full day. Therefore, we need

Version 2 using "contains partly": this creates query conditions like startdate <= 23:59 today AND enddate >= 0:00 today. This just exchanges the min and max value for start and end date, and therefore results in all bookings that partly contain today in their range.

Proposed resolution

Add a new operator and add the new condition.

Feature request
Status

Active

Version

4.1

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024