Less than or equals operator doesn't work with fields that have a time component

Created on 27 September 2022, about 2 years ago
Updated 12 July 2024, 5 months ago

Problem/Motivation

The less than or equals operators end up in the opSimple method in the parent filter, but for a date time field the use of strtotime with the date provided by the widget yields 12.00am on the selected day, ignoring any items that occur during the day, which are technically 'less than or equal' to the passed date.

Steps to reproduce

Add an exposed filter on a datetime field (e.g. node.changed) and enter a date in the filter. See it only includes items that occurred either at exactly midnight, or on the previous day

Proposed resolution

Add an offset of 1 day if using the less than or equals operator

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

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