From de916241590d4ecafc027aa23598023972eba348 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:01:19 +0300 Subject: [PATCH] fix(schedules): autofill schedule stuck --- src/utils/schedule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/schedule.js b/src/utils/schedule.js index c36da03909..b2e0c2173b 100644 --- a/src/utils/schedule.js +++ b/src/utils/schedule.js @@ -381,7 +381,7 @@ export const getPersonAutofillNoPartWithinMonth = (persons, week, assClass, assT let selected; const str = week.split('/'); - const currentDate = new Date(`${str('/')[0]}/${str[1]}/${str[2]}`); + const currentDate = new Date(`${str[0]}/${str[1]}/${str[2]}`); const lastMonth = addMonths(currentDate, -1); const nextMonth = addMonths(currentDate, 1); @@ -426,7 +426,7 @@ export const getPersonAutofillNoPartWithin2Weeks = (persons, week, assClass, ass let selected; const str = week.split('/'); - const currentDate = new Date(`${str('/')[0]}/${str[1]}/${str[2]}`); + const currentDate = new Date(`${str[0]}/${str[1]}/${str[2]}`); const lastMonth = addWeeks(currentDate, -2); const nextMonth = addWeeks(currentDate, 2);