Widget chart between table filter date

How could I modify the start and end of the Trend of a Widget that is within a page, using the date filter selected in the table? Right now I have like this. But I need it to be from the date selected in the filter.
->between(
start: now()->startOfMonth(),
end: now()->endOfMonth()
)
->between(
start: now()->startOfMonth(),
end: now()->endOfMonth()
)
1 Reply
H.Bilbao
H.Bilbao3mo ago
I just solved it as follows:
$backupMonth = $this->tableFilters['backup_month'];
$month = implode(', ', $backupMonth);

->between(
start: now()->modify($month)->startOfMonth(),
end: now()->modify($month)->endOfMonth(),
)
$backupMonth = $this->tableFilters['backup_month'];
$month = implode(', ', $backupMonth);

->between(
start: now()->modify($month)->startOfMonth(),
end: now()->modify($month)->endOfMonth(),
)
I don't know if there is a better way to do it, but it works for me.