From e788d0297d6b0f8c803791d8fa9944af411aab60 Mon Sep 17 00:00:00 2001 From: Manumartin95 Date: Mon, 9 Oct 2023 16:54:31 +0200 Subject: [PATCH] refactor: remove 5 days from the start and the end on availability table --- .../components/availability-table/availability-table.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/binnacle/features/availability/ui/components/availability-table/availability-table.tsx b/src/features/binnacle/features/availability/ui/components/availability-table/availability-table.tsx index f1c98bd9..d6f37978 100644 --- a/src/features/binnacle/features/availability/ui/components/availability-table/availability-table.tsx +++ b/src/features/binnacle/features/availability/ui/components/availability-table/availability-table.tsx @@ -30,8 +30,8 @@ export const AvailabilityTable: FC = () => { const selectedDateInterval = useMemo(() => { return { - start: chrono(selectedDate).startOf('month').minus(5, 'day').getDate(), - end: chrono(selectedDate).endOf('month').plus(5, 'day').getDate() + start: chrono(selectedDate).startOf('month').getDate(), + end: chrono(selectedDate).endOf('month').getDate() } }, [selectedDate]) @@ -51,8 +51,8 @@ export const AvailabilityTable: FC = () => { if (requiredFiltersAreSelected()) { getAbsencesQry({ ...absenceFilters, - startDate: chrono(selectedDateInterval.start).format(chrono.DATE_FORMAT), - endDate: chrono(selectedDateInterval.end).format(chrono.DATE_FORMAT) + startDate: chrono(selectedDateInterval.start).minus(5, 'day').format(chrono.DATE_FORMAT), + endDate: chrono(selectedDateInterval.end).plus(5, 'day').format(chrono.DATE_FORMAT) }).then((absences) => { setUserAbsences(absences) })