fixed error when selecting yesterday option from date filter, also added more options in the filter (#500)

This commit is contained in:
rammohan-y
2025-04-01 18:51:03 +05:30
committed by GitHub
parent f9e4c241f3
commit 38128b1531

View File

@@ -47,7 +47,12 @@ export const Alerts = () => {
count: Number(perPageFilter),
...(dateFilter === "today"
? { start: dayjs().startOf("date").toISOString() }
: { days: Number(dateFilter) }),
: dateFilter === "yesterday"
? {
start: dayjs().subtract(1, "day").startOf("day").toISOString(),
end: dayjs().subtract(1, "day").endOf("day").toISOString(),
}
: { days: Number(dateFilter) }),
};
getAlerts(accountSid, payload)
@@ -103,7 +108,7 @@ export const Alerts = () => {
id="date_filter"
label="Date"
filter={[dateFilter, setDateFilter]}
options={DATE_SELECTION.slice(0, 2)}
options={DATE_SELECTION}
/>
</section>
<Section {...(hasLength(alerts) && { slim: true })}>