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
If you have a period that spans the day of November 4, 2018 in a timezone where daylight savings is in effect, if you split that period by 10 or 30 minutes, it throws a Logic Exception with the message: "The ending datepoint must be greater or equal to the starting datepoint".
Standalone code, or other way to reproduce the problem
I pulled the repo and wrote this test to reproduce the bug.
public function testSplitDaylightSavingsDayIntoHours()
{
date_default_timezone_set('Canada/Central');
$period = new Period(new DateTime('2018-11-04 00:00:00.000000'), new DateTime('2018-11-05 00:00:00.000000'));
$splits = $period->split(new DateInterval('PT30M'));
foreach ($splits as $inner_period) {
self::assertNotNull($inner_period);
}
}
Expected result
To not throw an exception when daylight savings is the cause $startDate > $endDate.
Actual result
Throws an exception.
The text was updated successfully, but these errors were encountered:
@isEvrythngTkn thanks for reporting this bug. A Patch has landed on the master branch also I've added your test to the test suite and also checked that Period::splitBackward did not suffer from the same issue.
Could you have a look and tell me if it's all good for you ? If no I may release a patch fix this week of the week after
Bug Report
Summary
If you have a period that spans the day of November 4, 2018 in a timezone where daylight savings is in effect, if you split that period by 10 or 30 minutes, it throws a Logic Exception with the message: "The ending datepoint must be greater or equal to the starting datepoint".
Standalone code, or other way to reproduce the problem
I pulled the repo and wrote this test to reproduce the bug.
Expected result
To not throw an exception when daylight savings is the cause $startDate > $endDate.
Actual result
Throws an exception.
The text was updated successfully, but these errors were encountered: