Wrong end of month at Reports for Europe/Berlin time zone if month contains 31 day #15940
Labels
Fixed in 2.1.x
The issue has been fixed in 2.1 release line
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Preconditions
Steps to reproduce
Expected result
Actual result
Comment:
MAGE_ROOT/vendor/magento/module-reports/Model/ResourceModel/Report/Collection.php:218
$interval['end'] filled with 30.05.2018 instead of 31.05.2018
My solution:
Replace: $dateStart->format('Y-m-' . date('t', $dateStart->getTimestamp()) . ' 23:59:59')
with:
$dateStart->format('Y-m-' . cal_days_in_month(CAL_GREGORIAN, $dateStart->format('m'), $dateStart->format('Y')) . ' 23:59:59')
System:
Ububntu16.04/MySQL5.7/PHP7.0
The text was updated successfully, but these errors were encountered: