Skip to content

Daterange filter uses invalid max timestamp for MySQL compatibility #1418

@fanti1

Description

@fanti1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions