diff --git a/packages/features/schedules/components/Schedule.tsx b/packages/features/schedules/components/Schedule.tsx index 1f0d0e71f9..77740cbe47 100644 --- a/packages/features/schedules/components/Schedule.tsx +++ b/packages/features/schedules/components/Schedule.tsx @@ -169,6 +169,7 @@ export const DayRanges = ({ control?: Control; }) => { const { t } = useLocale(); + const { getValues } = useFormContext(); const { remove, fields, append } = useFieldArray({ control, @@ -191,7 +192,7 @@ export const DayRanges = ({ StartIcon={Plus} onClick={() => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const nextRange: any = getNextRange(fields[fields.length - 1]); + const nextRange: any = getNextRange(getValues(`${name}.${fields.length - 1}`)); if (nextRange) append(nextRange); }} />