
Originally Posted by
gothstone
https://dev.pezcollectors.com/blank
ZC1.5.8
Only display logs plugin
PHP 8.1.24
MariaDB 10.6.15
When adding a new special or featured product, or editing an existing one, the active from aka featured_date_available does not take UNLESS it's a future date. If you select today or in the past, it uses the default of 0001-01-01
That's expected behavior for dates in the past, but a featured/special product starting "today" should be accepted and recorded.
For the /admin/featured.php, find the statements (2 each) that currently read
Code:
$featured_date_available = (date('Y-m-d') < $featured_date_available_raw) ? $featured_date_available_raw : '0001-01-01';
$expires_date = (date('Y-m-d') < $expires_date_raw) ? $expires_date_raw : '0001-01-01';
and change to
Code:
$featured_date_available = (date('Y-m-d') <= $featured_date_available_raw) ? $featured_date_available_raw : '0001-01-01';
$expires_date = (date('Y-m-d') <= $expires_date_raw) ? $expires_date_raw : '0001-01-01';
Similarly, for the /admin/specials.php, find the statements (2 each) that currently read
Code:
$specials_date_available = (date('Y-m-d') < $specials_date_available_raw) ? $specials_date_available_raw : '0001-01-01';
$expires_date = (date('Y-m-d') < $expires_date_raw) ? $expires_date_raw : '0001-01-01';
and change to
Code:
$specials_date_available = (date('Y-m-d') <= $specials_date_available_raw) ? $specials_date_available_raw : '0001-01-01';
$expires_date = (date('Y-m-d') <= $expires_date_raw) ? $expires_date_raw : '0001-01-01';
Bookmarks