Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WhenMeet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem2023-2
WhenMeet
Commits
4aeafcfa
Commit
4aeafcfa
authored
1 year ago
by
이권민
Browse files
Options
Downloads
Patches
Plain Diff
[EDIT] UserTimeInfo 상태 반영 시간 계산
parent
7b6eca3b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
react-whenMeet/src/components/CalendarWeek2.jsx
+1
-1
1 addition, 1 deletion
react-whenMeet/src/components/CalendarWeek2.jsx
react-whenMeet/src/routes/UserTimeInfo.js
+21
-4
21 additions, 4 deletions
react-whenMeet/src/routes/UserTimeInfo.js
with
22 additions
and
5 deletions
react-whenMeet/src/components/CalendarWeek2.jsx
+
1
−
1
View file @
4aeafcfa
...
@@ -47,7 +47,7 @@ function CaculateWeek({ nowYear, nowMonth, week, availableTimes, setAvailableTim
...
@@ -47,7 +47,7 @@ function CaculateWeek({ nowYear, nowMonth, week, availableTimes, setAvailableTim
const
handleClick
=
()
=>
{
const
handleClick
=
()
=>
{
for
(
let
day
=
fDay
;
day
<=
eDay
;
day
+=
(
60
*
60
*
24
*
1000
)){
for
(
let
day
=
fDay
;
day
<=
eDay
;
day
+=
(
60
*
60
*
24
*
1000
)){
for
(
let
indx
=
0
;
indx
<
10
;
indx
++
){
for
(
let
indx
=
startTime
;
indx
<=
endTime
;
indx
++
){
const
elm
=
document
.
getElementById
(
day
+
indx
);
const
elm
=
document
.
getElementById
(
day
+
indx
);
elm
.
classList
.
remove
(
"
dragging
"
)
elm
.
classList
.
remove
(
"
dragging
"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
react-whenMeet/src/routes/UserTimeInfo.js
+
21
−
4
View file @
4aeafcfa
...
@@ -12,10 +12,10 @@ function UserTimeInfo() {
...
@@ -12,10 +12,10 @@ function UserTimeInfo() {
const
{
id
}
=
useParams
();
const
{
id
}
=
useParams
();
const
[
startTime
,
setStartTime
]
=
useState
(
0
);
const
[
startTime
,
setStartTime
]
=
useState
(
0
);
const
[
endTime
,
setEndTiem
]
=
useState
(
48
);
const
[
endTime
,
setEndTiem
]
=
useState
(
10
);
const
[
today
,
setToday
]
=
useState
(
new
Date
());
const
[
today
,
setToday
]
=
useState
(
new
Date
());
const
[
startDate
,
setStartDate
]
=
useState
(
new
Date
(
2023
,
10
,
30
));
const
[
startDate
,
setStartDate
]
=
useState
(
new
Date
(
2023
,
10
,
30
));
const
[
endDate
,
setEndDate
]
=
useState
(
new
Date
(
2023
,
11
,
4
));
const
[
endDate
,
setEndDate
]
=
useState
(
new
Date
(
2023
,
11
,
2
));
const
handleState
=
()
=>
{
const
handleState
=
()
=>
{
...
@@ -38,8 +38,25 @@ function UserTimeInfo() {
...
@@ -38,8 +38,25 @@ function UserTimeInfo() {
},
[
id
]);
},
[
id
]);
const
handleAlert
=
()
=>
{
const
handleAlert
=
()
=>
{
let
sat
=
[...
availableTimes
].
sort
();
// let sat = [...availableTimes].sort();
console
.
log
(
availableTimes
);
const
sat
=
[];
// state에 따라서 가능한 시간을 선택한 거라면 그냥 넘어가고
// 불가능한 시간을 선택한 거라면 전부 날짜 범위에 맞춰서 뒤집어줘야 한다.
// 여기 수정해야함
if
(
!
state
){
for
(
let
day
=
startDate
-
0
;
day
<=
endDate
-
0
;
day
+=
((
60
*
60
*
24
*
1000
))){
for
(
let
time
=
startTime
;
time
<
endTime
;
time
++
){
if
(
!
availableTimes
.
includes
(
day
+
time
)){
sat
.
push
(
day
+
time
);
}
}
}
}
else
{
sat
.
push
(...
availableTimes
);
}
sat
.
sort
();
console
.
log
(
state
,
sat
);
const
aa
=
[];
const
aa
=
[];
let
t
=
[];
let
t
=
[];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment