Daterange filter uses invalid max timestamp for MySQL compatibility
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.5k
- Forks
- 246
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 7
Description
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
- Go to any backend list with a date filter.
- Select only the start date, leaving the end date empty.
- Apply the filter and export or query the data.
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the backend Filter widget's date and daterange handling, following the path used when only a start date is selected. Confirm where 2999-12-31 23:59:59 is produced, change the fallback to the stated MySQL-compatible maximum, and verify that filtering or exporting no longer causes SQL errors or data truncation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, mysql, php
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100