upd
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
eachDayOfInterval,
|
||||
endOfMonth,
|
||||
format,
|
||||
getDay,
|
||||
getISODay,
|
||||
isEqual,
|
||||
isWithinInterval,
|
||||
parse,
|
||||
@@ -89,7 +89,7 @@ function Calendar({ schedules, handleSelect, className }: CalendarProps) {
|
||||
<div
|
||||
key={day.toString()}
|
||||
className={classNames(
|
||||
dayIdx === 0 && colStartClasses[getDay(day) - 1]
|
||||
dayIdx === 0 && colStartClasses[getISODay(day) - 1]
|
||||
)}
|
||||
>
|
||||
<button
|
||||
@@ -100,7 +100,7 @@ function Calendar({ schedules, handleSelect, className }: CalendarProps) {
|
||||
(schedule) =>
|
||||
!isWithinInterval(day, {
|
||||
start: new Date(schedule.startDate),
|
||||
end: addDays(new Date(schedule.startDate), 14),
|
||||
end: addDays(new Date(schedule.startDate), 13),
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ function SidebarTab1() {
|
||||
companyId,
|
||||
buildId,
|
||||
} = useSidebarTabStore();
|
||||
const [schedules, setSchedules] = useState<any[]>();
|
||||
const [schedules, setSchedules] = useState<any[]>([]);
|
||||
|
||||
function handleSelectDay(day: Date) {
|
||||
setSelectedDay(day);
|
||||
@@ -79,7 +79,7 @@ function SidebarTab1() {
|
||||
</div>
|
||||
|
||||
<div className="sm:mt-8 mt-6">
|
||||
{schedules && schedules.length > 0 ? (
|
||||
{schedules.length > 0 ? (
|
||||
<Calendar
|
||||
schedules={schedules}
|
||||
handleSelect={(day) => handleSelectDay(day)}
|
||||
|
||||
@@ -5,7 +5,12 @@ import { Trans } from "react-i18next";
|
||||
import useSidebarTabStore from "../stores/useSidebarStore";
|
||||
import TimeSelector from "./TimeSelector";
|
||||
import CloseIcon from "./icons/CloseIcon";
|
||||
import { eachMinuteOfInterval, format, isAfter, parse } from "date-fns";
|
||||
import {
|
||||
eachMinuteOfInterval,
|
||||
format,
|
||||
isAfter,
|
||||
parse,
|
||||
} from "date-fns";
|
||||
import i18n from "../i18n";
|
||||
import { enUS, ru } from "date-fns/locale";
|
||||
import ky from "ky";
|
||||
@@ -84,6 +89,9 @@ function SidebarTab2() {
|
||||
if (!selectedDay || !build || !scheduledSessions || !schedule) return;
|
||||
|
||||
const step = schedule.sessionDuration + schedule.sessionBreak;
|
||||
|
||||
console.log("selectedDay", selectedDay);
|
||||
|
||||
const times = eachMinuteOfInterval(
|
||||
{
|
||||
start: parse(schedule.startTime, "HH:mm", selectedDay),
|
||||
|
||||
Reference in New Issue
Block a user