Release 2.0.2 (#3856)
* allow to overwrite global spreadsheet styles * bump version * fix deprecations in vcard download * bump composer packages * added help page for all registered locales * fix menu id's, cleanup times route, fix configurable homepage redirect * format duration without leading zero in hours (unify javascript with php behavior) * fix active records in all screen sizes * improved responsiveness in XS * fixed invoice number for customer null fields * fix javascript respects multiple recent-activity dropdowns * show recent activities on small screens * fix user-profile layout column in XS * fix search is always marked as active
This commit is contained in:
@@ -9,9 +9,10 @@
|
||||
|
||||
namespace App\Form\Model;
|
||||
|
||||
use App\Utils\EquatableInterface;
|
||||
use DateTime;
|
||||
|
||||
final class DateRange
|
||||
final class DateRange implements EquatableInterface
|
||||
{
|
||||
private ?DateTime $begin = null;
|
||||
private ?DateTime $end = null;
|
||||
@@ -49,4 +50,29 @@ final class DateRange
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isEqualTo(object $compare): bool
|
||||
{
|
||||
if (!$compare instanceof DateRange) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($this->getBegin() === null && $compare->getBegin() !== null) || ($this->getBegin() !== null && $compare->getBegin() === null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($this->getEnd() === null && $compare->getEnd() !== null) || ($this->getEnd() !== null && $compare->getEnd() === null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getBegin() !== null && $compare->getBegin() !== null && $this->getBegin()->getTimestamp() !== $compare->getBegin()->getTimestamp()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getEnd() !== null && $compare->getEnd() !== null && $this->getEnd()->getTimestamp() !== $compare->getEnd()->getTimestamp()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user