Apply Date Range filter if only min or max value is specified

Created on 18 July 2022, over 2 years ago
Updated 10 December 2023, over 1 year ago

Problem/Motivation

The default implementation of Between operator in Date field only applies query condition if both min and max values are specified.
This behavior is not what user would expect if they'd only specify 'from' or 'to' value in exposed form.

This matches core Views behavior, however, there's a bug report in core for this:
πŸ› Expose Date Range Filter with missing min or max returns all results Needs work

Once core behavior is changed, Search API should follow it.

Steps to reproduce

1. Create an index with Date field.
2. Create a View with exposed date field filter, configure it to use Between behavior.
3. As a user, open the View page and fill in either Min or Max filter field.
Expected: the filter should apply.
Actual: the filter does not apply.

Proposed resolution

Apply the patch to match Drupal core behavior.

Remaining tasks

Wait for πŸ› Expose Date Range Filter with missing min or max returns all results Needs work to land, add tests.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Views integration

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024