Closed adrianrudnik closed 3 years ago
Might be just brain-fart, but what is the correct way to see if a period is fully contained within a given other period?
A [===] B [=] Result: true A [===] B [==] Result false A [===] B [==] Result true A [===] B [===] Result true A [===] B [===] Result false
I just see a contains function that accepts a DateTimeInterface. Is it
contains
DateTimeInterface
$c = $a->overlapSingle($b); return $b->equals($c);
or am I missing something with the precision that could go wrong?
That's the way I've done it in the past. We could make contains work with periods instead, but that would be a breaking change… I'll revisit this for the next version.
Might be just brain-fart, but what is the correct way to see if a period is fully contained within a given other period?
I just see a
contains
function that accepts aDateTimeInterface
. Is itor am I missing something with the precision that could go wrong?