Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
축제에
진행 중뱃지 표시 로직 수정 (날짜 계산 부분)서버에서 받는 시간대를 Date객체로 생성 시 kst기준 오전 9시로 설정되고 초기화 됩니다.
저희가 축제 남은 시간 계산을 위해 Date객체를 생성 시 kst 현재 시각으로 초기화가 됩니다.
따라서 기존의 로직대로 오전 9시 이후에 뺄셈을 했을때 리턴값이 음수가 되므로, 당일 마감 축제의 경우 진행중 뱃지가 뜨지 않는 현상이 발생합니다.
이를 수정하기 위해, 서버에서 받은 날짜를 Date객체로 생성시, 23:59:59로 초기화가 되도록 수정하였습니다.
(+ 자바스크립트 문법 상 인덱스0-11이 1월부터 12월을 가르키므로 month에만 -1을 해줍니다.)
아래 스크린샷은 비교를 위해 기존 로직의 마감시간 :
EndDate,수정로직의 마감시간:EndDate2로 한 후 console.log()한 것입니다.