Skip to content
Snippets Groups Projects
Commit 9dfb4fb3 authored by 이권민's avatar 이권민
Browse files

[EDIT] usertimeinfo 수정

parent 4b45dad7
No related branches found
No related tags found
No related merge requests found
...@@ -57,16 +57,7 @@ function CaculateWeek({ ...@@ -57,16 +57,7 @@ function CaculateWeek({
}; };
const handleClick = (newDate, idx, comp) => { const handleClick = (newDate, idx, comp) => {
// for(let day = fDay; day <= eDay; day+=(60*60*24*1000)){
// for(let indx = startTime; indx <= endTime; indx++){
// const elm = document.getElementById(day + indx);
// elm.classList.remove("dragging")
// }
// }
// setAvailableTimes([])
const elm2 = document.getElementById(comp); const elm2 = document.getElementById(comp);
// console.log(comp, elm2);
if (isContain(newDate - 0 + idx) || elm2.classList.contains("dragging")) { if (isContain(newDate - 0 + idx) || elm2.classList.contains("dragging")) {
const elm = document.getElementById(newDate - 0 + idx); const elm = document.getElementById(newDate - 0 + idx);
elm.classList.remove("dragging"); elm.classList.remove("dragging");
...@@ -84,8 +75,6 @@ function CaculateWeek({ ...@@ -84,8 +75,6 @@ function CaculateWeek({
const selectArr = []; const selectArr = [];
weekArr.push(<td></td>); weekArr.push(<td></td>);
// 시작 끝 값을 수정해서 일정 변경
// console.log(startTime, endTime);
for (let i = startTime; i < endTime; i++) { for (let i = startTime; i < endTime; i++) {
const forSelect = []; const forSelect = [];
const minute = i * 30; const minute = i * 30;
...@@ -146,7 +135,8 @@ function CaculateWeek({ ...@@ -146,7 +135,8 @@ function CaculateWeek({
selectArr.push( selectArr.push(
<tr key={i}> <tr key={i}>
{time} {forSelect} <td>{time}</td>
{forSelect}
</tr> </tr>
); );
} }
...@@ -215,7 +205,6 @@ function CalendarWeek2({ ...@@ -215,7 +205,6 @@ function CalendarWeek2({
setNowWeek(newWeek); setNowWeek(newWeek);
setNowMonth(newMonth); setNowMonth(newMonth);
setNowYear(newYear); setNowYear(newYear);
// setCurrentDay(new Date(nowYear, nowMonth - 1, 1*(nowWeek-1) + nowDay));
}; };
const nextWeek = () => { const nextWeek = () => {
let newWeek = nowWeek + 1; let newWeek = nowWeek + 1;
...@@ -238,29 +227,31 @@ function CalendarWeek2({ ...@@ -238,29 +227,31 @@ function CalendarWeek2({
return ( return (
<div className="calendar"> <div className="calendar">
<div className="header"> <div className="header">
<button onClick={prevWeek}>prev</button> <h2>
<h4> <button onClick={prevWeek}>prev</button>
{nowYear}{nowMonth}{nowWeek}주차 {nowYear}{nowMonth}{nowWeek}주차
</h4> <button onClick={nextWeek}>next</button>
<button onClick={nextWeek}>next</button> </h2>
</div> </div>
{state ? <p>가능한 시간</p> : <p>불가능한 시간</p>} {state ? <p>가능한 시간</p> : <p>불가능한 시간</p>}
<table className="calendarTable"> <div className="calendarTable">
<MakeDay2 /> <table>
<CaculateWeek <MakeDay2 />
week={nowWeek} <CaculateWeek
nowYear={nowYear} week={nowWeek}
nowMonth={nowMonth} nowYear={nowYear}
startDate={startDate} nowMonth={nowMonth}
endDate={endDate} startDate={startDate}
startTime={startTime} endDate={endDate}
endTime={endTime} startTime={startTime}
availableSchedules={availableSchedules} endTime={endTime}
availableTimes={availableTimes} availableSchedules={availableSchedules}
setAvailableTimes={setAvailableTimes} availableTimes={availableTimes}
isContain={isContain} setAvailableTimes={setAvailableTimes}
/> isContain={isContain}
</table> />
</table>
</div>
</div> </div>
); );
} }
......
...@@ -4,6 +4,8 @@ import CalendarWeek2 from "../components/CalendarWeek2"; ...@@ -4,6 +4,8 @@ import CalendarWeek2 from "../components/CalendarWeek2";
import axios from "axios"; import axios from "axios";
import { useLocation, useNavigate, useParams } from "react-router-dom"; import { useLocation, useNavigate, useParams } from "react-router-dom";
import "../styles/UserTimeInfo.css";
function UserTimeInfo() { function UserTimeInfo() {
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
...@@ -26,7 +28,6 @@ function UserTimeInfo() { ...@@ -26,7 +28,6 @@ function UserTimeInfo() {
let st = 0; let st = 0;
let et = 48; let et = 48;
console.log(location.state.startTime, location.state.endTime);
if ( if (
!( !(
location.state.startTime === location.state.endTime && location.state.startTime === location.state.endTime &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment