Skip to content

Commit

Permalink
fix(schedules): autofill schedule stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Oct 2, 2023
1 parent a44acfd commit de91624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit de91624

Please sign in to comment.