fix: properly filter by date range, improve filter handlers
This commit is contained in:
@@ -6,8 +6,27 @@ use Carbon\CarbonPeriod;
|
||||
|
||||
class TimelineFilterDto extends AssignmentFilterDto
|
||||
{
|
||||
protected bool $includePast = true;
|
||||
protected ?CarbonPeriod $_period = null;
|
||||
|
||||
public function getDateFrom(): ?\DateTimeImmutable
|
||||
{
|
||||
if (null === $this->dateFrom) {
|
||||
return $this->_period->first()->toDateTimeImmutable();
|
||||
}
|
||||
|
||||
return $this->dateFrom;
|
||||
}
|
||||
|
||||
public function getDateTo(): ?\DateTimeImmutable
|
||||
{
|
||||
if (null === $this->dateTo) {
|
||||
return $this->_period->last()->toDateTimeImmutable();
|
||||
}
|
||||
|
||||
return $this->dateTo;
|
||||
}
|
||||
|
||||
public function getPeriod(): ?CarbonPeriod
|
||||
{
|
||||
return $this->_period;
|
||||
|
||||
Reference in New Issue
Block a user