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
715cfcba
Commit
715cfcba
authored
1 year ago
by
준현 강
Browse files
Options
Downloads
Patches
Plain Diff
[EDIT] /result 페이지 남은 시간 계산 로직 수정
parent
c51a54d6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
react-whenMeet/src/components/ResultMakeForm.js
+11
-13
11 additions, 13 deletions
react-whenMeet/src/components/ResultMakeForm.js
with
11 additions
and
13 deletions
react-whenMeet/src/components/ResultMakeForm.js
+
11
−
13
View file @
715cfcba
...
...
@@ -108,22 +108,20 @@ function ResultMakeForm() {
}
const
voteExpiresKST
=
new
Date
(
meetingData
.
voteExpiresAt
);
const
now
=
new
Date
();
const
nowKST
=
new
Date
(
now
.
getTime
()
+
9
*
60
*
60
*
1000
);
// UTC 시간에 9시간을 더해 KST로 조정
const
nowKST
=
new
Date
(
now
.
getTime
());
// UTC 시간에 9시간을 더해 KST로 조정
const
difference
=
voteExpiresKST
-
nowKST
;
if
(
difference
>
0
)
{
return
{
days
:
Math
.
floor
(
difference
/
(
1000
*
60
*
60
*
24
)),
hours
:
Math
.
floor
((
difference
/
(
1000
*
60
*
60
))
%
24
),
minutes
:
Math
.
floor
((
difference
/
1000
/
60
)
%
60
),
seconds
:
Math
.
floor
((
difference
/
1000
)
%
60
),
};
}
else
{
if
(
difference
<=
0
)
{
navigate
(
`/resultend/
${
meeting_id
}
`
);
return
{
days
:
0
,
hours
:
0
,
minutes
:
0
,
seconds
:
0
};
}
return
{
days
:
Math
.
floor
(
difference
/
(
1000
*
60
*
60
*
24
)),
hours
:
Math
.
floor
((
difference
/
(
1000
*
60
*
60
))
%
24
),
minutes
:
Math
.
floor
((
difference
/
1000
/
60
)
%
60
),
seconds
:
Math
.
floor
((
difference
/
1000
)
%
60
),
};
};
const
updateTimer
=
()
=>
{
...
...
@@ -138,7 +136,7 @@ function ResultMakeForm() {
const
timerId
=
setInterval
(
updateTimer
,
1000
);
return
()
=>
clearInterval
(
timerId
);
},
[
meetingData
]);
},
[
meetingData
,
navigate
,
meeting_id
]);
const
handleEdit
=
async
()
=>
{
try
{
...
...
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