-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] useCountdownTimer 서버 시간 오차 이슈 해결 (#48)
* fix: useCountdownTimer 서버 시간 오차 이슈 해결 * fix: lint 에러 수정 * feat: api params 수정 대응
- Loading branch information
Showing
6 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function calcRemainingTime(endTimeInCountRemainingTime: Date) { | ||
const nowTime = new Date(); | ||
|
||
if (endTimeInCountRemainingTime.getTime() < nowTime.getTime()) { | ||
return 0; | ||
} | ||
|
||
return endTimeInCountRemainingTime.getTime() - nowTime.getTime(); | ||
} | ||
|
||
export default calcRemainingTime; |