Skip to content

Commit 4e55513

Browse files
limgitclaude
andcommitted
fix: use UTC timezone in formatRelativeTime to avoid snapshot drift
toLocaleDateString() without a timezone produces different dates depending on the machine's timezone, causing snapshot mismatches between local (KST) and CI (UTC). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 96aa079 commit 4e55513

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/utils/display.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ export function formatRelativeTime(dateString: string): string {
8686
} else if (diffDays < 7) {
8787
return diffDays === 1 ? "1 day ago" : `${diffDays} days ago`
8888
} else {
89-
return commentDate.toLocaleDateString()
89+
return commentDate.toLocaleDateString(undefined, { timeZone: "UTC" })
9090
}
9191
}

test/commands/issue/__snapshots__/issue-view.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Users are experiencing issues logging in when their session expires.
7070
7171
## Comments
7272
73-
- **@Bob Senior** - *1/16/2024*
73+
- **@Bob Senior** - *1/15/2024*
7474
7575
Should we also consider implementing automatic session refresh?
7676
@@ -82,7 +82,7 @@ Users are experiencing issues logging in when their session expires.
8282
8383
Working on a fix. Will increase the session timeout and add proper error handling.
8484
85-
- **@Alice Developer** - *1/16/2024*
85+
- **@Alice Developer** - *1/15/2024*
8686
8787
Sounds good! Also, we should add better error messaging for expired sessions.
8888

0 commit comments

Comments
 (0)