winter icon indicating copy to clipboard operation
winter copied to clipboard

Daterange filter uses invalid max timestamp for MySQL compatibility

Open fanti1 opened this issue 2 months ago • 2 comments

Winter CMS Build

dev-develop

PHP Version

8.4

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

When using the backend Filter widget for date or daterange fields, if only the start date is selected, the filter automatically fills the end date with 2999-12-31 23:59:59. This value exceeds the maximum allowed for MySQL TIMESTAMP fields (2038-01-19 03:14:07), causing SQL errors or data truncation.

Steps to replicate

Steps to Reproduce

  1. Go to any backend list with a date filter.
  2. Select only the start date, leaving the end date empty.
  3. Apply the filter and export or query the data.
  4. The filter value for the end date will be 2999-12-31 23:59:59.

Expected Behavior

The filter should use the maximum MySQL TIMESTAMP value (2038-01-19 03:14:07) when the end date is not set, to ensure compatibility.

Actual Behavior The filter uses 2999-12-31 23:59:59, which is not compatible with MySQL TIMESTAMP fields.

Workaround

No response

fanti1 avatar Oct 20 '25 14:10 fanti1

What version of MySQL / MariaDB are you using?

LukeTowers avatar Oct 20 '25 16:10 LukeTowers

What version of MySQL / MariaDB are you using?

Hi Luke, this: Ver 8.0.43-0ubuntu0.24.04.2

fanti1 avatar Oct 20 '25 16:10 fanti1