You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When comparing two dates of the same timezone where one of them is closer to 00:00 than the timezone offset, isSame and isBefore will return the wrong result when comparing by day:
$date = new \Moment\Moment('2018-05-16 00:30:00', 'Europe/Copenhagen');
$date2 = new \Moment\Moment('2018-05-16 22:00:00', 'Europe/Copenhagen');
echo 'Is same day: '.($date->isSame($date2, 'day')?'Yes':'No');
Expected output: Is same day: Yes
Actual output: Is same day: No
After inspecting the code, i found out it's due to the fact that the dates is converted to UTC before calling startOf($period).
The text was updated successfully, but these errors were encountered:
When comparing two dates of the same timezone where one of them is closer to 00:00 than the timezone offset, isSame and isBefore will return the wrong result when comparing by day:
Expected output:
Is same day: Yes
Actual output:
Is same day: No
After inspecting the code, i found out it's due to the fact that the dates is converted to UTC before calling startOf($period).
The text was updated successfully, but these errors were encountered: