Skip to content

[Fix] daysUntil 타임존 경계 하루 오차 수정 - #217

Merged
BcKmini merged 1 commit into
mainfrom
fix/days-until-timezone
Jul 31, 2026
Merged

[Fix] daysUntil 타임존 경계 하루 오차 수정#217
BcKmini merged 1 commit into
mainfrom
fix/days-until-timezone

Conversation

@BcKmini

@BcKmini BcKmini commented Jul 31, 2026

Copy link
Copy Markdown
Member

요약

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 lint
  • npx vitest run (328 tests passed — 이전에 간헐 실패하던 테스트들도 안정적으로 통과)
  • npm run build

"YYYY-MM-DD"를 new Date()로 바로 파싱하면 UTC 자정으로 해석되는데,
이후 로컬 자정 기준 today와 비교해 타임존에 따라 하루가 어긋났다.
Y/M/D를 직접 꺼내 로컬 자정으로 만들도록 수정하고, 관련 테스트의
isoDateOffset 헬퍼들도 toISOString(UTC) 대신 로컬 날짜 문자열을
만들도록 맞췄다.
@BcKmini
BcKmini merged commit 50370ff into main Jul 31, 2026
@BcKmini
BcKmini deleted the fix/days-until-timezone branch July 31, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] daysUntil이 타임존 경계에서 하루 오차 발생 (로컬 자정 vs UTC 자정 비교)

1 participant