Pull request: merge schedule

Updates #6177

Squashed commit of the following:

commit 2f8e4164d40af338d9e4664d5c9ea0aab7113e26
Author: Ildar Kamalov <ik@adguard.com>
Date:   Fri Sep 8 10:09:32 2023 +0300

    client: merge schedule
This commit is contained in:
Ildar Kamalov 2023-09-08 13:23:00 +03:00
parent acf539b11d
commit 62da8f4974
1 changed files with 8 additions and 23 deletions

View File

@ -72,31 +72,16 @@ export const Modal = ({
const onFormSubmit = (e) => {
e.preventDefault();
if (currentDay) {
const newSchedule = schedule;
const newSchedule = schedule;
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
onSubmit(newSchedule);
} else {
const newSchedule = {
time_zone: timezone,
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
onSubmit(newSchedule);
}
onSubmit(newSchedule);
};
return (
@ -133,7 +118,7 @@ export const Modal = ({
>
{getShortDayName(t, day)}
</button>
)) }
))}
</div>
<div className="schedule__time-wrap">