upd
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
# VITE_API_URL=http://localhost:3001
|
||||
VITE_API_URL=http://localhost:3001
|
||||
# VITE_API_URL=http://192.168.1.171:3001
|
||||
VITE_API_URL=https://crm.stream.graff.tech/api
|
||||
# VITE_API_URL=https://crm.stream.graff.tech/api
|
||||
VITE_STREAM_URL=https://stream.graff.tech
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import {
|
||||
addMonths,
|
||||
format,
|
||||
getDay,
|
||||
getDaysInMonth,
|
||||
getISODay,
|
||||
isSameDay,
|
||||
isToday,
|
||||
setDate,
|
||||
startOfDay,
|
||||
startOfMonth,
|
||||
subMonths,
|
||||
} from "date-fns";
|
||||
import { useState } from "react";
|
||||
@@ -22,7 +24,9 @@ import useStore from "../stores/useStore";
|
||||
function Calendar() {
|
||||
const { selectedDay, setSelectedDay } = useStore();
|
||||
const { isShowCalendar, setIsShowCalendar } = useSettingsStore();
|
||||
const [currentMonth, setCurrentMonth] = useState<Date>(new Date());
|
||||
const [currentMonth, setCurrentMonth] = useState<Date>(
|
||||
startOfMonth(startOfDay(new Date()))
|
||||
);
|
||||
|
||||
function selectPrevMonth() {
|
||||
setCurrentMonth(subMonths(currentMonth, 1));
|
||||
@@ -74,11 +78,11 @@ function Calendar() {
|
||||
))}
|
||||
</div>
|
||||
<div className="grid grid-cols-7 gap-2">
|
||||
{Array.from({ length: getISODay(currentMonth) - 1 }).map(
|
||||
(_, index) => (
|
||||
<div key={index} className="w-8 h-8"></div>
|
||||
)
|
||||
)}
|
||||
{Array.from({
|
||||
length: getDay(startOfDay(startOfMonth(currentMonth))) - 1,
|
||||
}).map((_, index) => (
|
||||
<div key={index} className="w-8 h-8"></div>
|
||||
))}
|
||||
{Array.from({ length: getDaysInMonth(currentMonth) }).map(
|
||||
(_, index) => (
|
||||
<button
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Link } from "react-router-dom";
|
||||
import IUser from "../types/IUser";
|
||||
import useAuthStore from "../stores/useAuthStore";
|
||||
import EntryIcon from "./icons/EntryIcon";
|
||||
import { isAfter } from "date-fns";
|
||||
import { isAfter, subMinutes } from "date-fns";
|
||||
|
||||
interface CardProps {
|
||||
companyId: string;
|
||||
@@ -112,7 +112,10 @@ function Card({
|
||||
<div className="flex gap-2">
|
||||
{user?.role === "manager" &&
|
||||
(manager ? (
|
||||
isAfter(new Date(), new Date(scheduleSessionStartAt)) ? (
|
||||
isAfter(
|
||||
new Date(),
|
||||
subMinutes(new Date(scheduleSessionStartAt), 10)
|
||||
) ? (
|
||||
<Link
|
||||
to={`${
|
||||
import.meta.env.VITE_STREAM_URL
|
||||
|
||||
Reference in New Issue
Block a user