Closed alnidok closed 5 years ago
Hello. I get Exception\CannotComparePeriods when I use precision parameter with comparing multiple periods. Examples:
precision
// Diff between multiple periods $a = Period::make('2018-01-05 00:00:00', '2018-01-10 00:00:00', Precision::MINUTE); $b = Period::make('2018-01-15 00:00:00', '2018-03-01 00:00:00', Precision::MINUTE); $c = Period::make('2018-01-01 00:00:00', '2018-01-31 00:00:00', Precision::MINUTE); $diff = $c->diff($a, $b);
or
// Overlap with all periods $a = Period::make('2018-01-01 00:00:00', '2018-01-31 00:00:00', Precision::MINUTE); $b = Period::make('2018-01-10 00:00:00', '2018-01-15 00:00:00', Precision::MINUTE); $c = Period::make('2018-01-10 00:00:00', '2018-01-31 00:00:00', Precision::MINUTE); $overlap = $a->overlapAll($b, $c);
Thanks for reporting this bug, it's fixed in 0.5.1: https://github.com/spatie/period/releases/tag/0.5.1
Hello. I get Exception\CannotComparePeriods when I use
precision
parameter with comparing multiple periods. Examples:or