[Fix] daysUntil 타임존 경계 하루 오차 수정 - #217
Merged
Merged
Conversation
"YYYY-MM-DD"를 new Date()로 바로 파싱하면 UTC 자정으로 해석되는데, 이후 로컬 자정 기준 today와 비교해 타임존에 따라 하루가 어긋났다. Y/M/D를 직접 꺼내 로컬 자정으로 만들도록 수정하고, 관련 테스트의 isoDateOffset 헬퍼들도 toISOString(UTC) 대신 로컬 날짜 문자열을 만들도록 맞췄다.
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.
요약
daysUntil()이 "YYYY-MM-DD"를new Date()로 파싱(UTC 자정)한 뒤 로컬 자정 기준today와 비교해, 로컬 타임존이 UTC가 아니면 하루 오차가 났다. Y/M/D를 직접 꺼내 로컬 자정으로target을 만들도록 수정.같은 원인으로
WorkerListPage.test.tsx의 "colors the deadline text by urgency tier" 등 여러 테스트가 간헐 실패했다 — 테스트의isoDateOffset헬퍼가toISOString()(UTC)으로 날짜 문자열을 만들었기 때문. 로컬 날짜 문자열을 만들도록 통일했다.Closes #216
Test plan
npm run lintnpx vitest run(328 tests passed — 이전에 간헐 실패하던 테스트들도 안정적으로 통과)npm run build