-
Notifications
You must be signed in to change notification settings - Fork 222
feat(changelog): extract and display published date for changelog entries #1465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||
| export function formatChangelogPublishedAt(value?: string): string | null { | ||||||||||||
| if (!value) return null; | ||||||||||||
|
|
||||||||||||
| const parsed = new Date(value); | ||||||||||||
| if (Number.isNaN(parsed.getTime())) return value; | ||||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ISO date-only strings parsed as UTC midnight, causing off-by-one day for users in negative-offset timezones When This PR introduces new paths that can write ISO date-only strings into To prevent the timezone shift, parse date-only strings explicitly as local midnight instead of UTC:
Suggested change
Adding a local-time suffix ( |
||||||||||||
|
|
||||||||||||
| return new Intl.DateTimeFormat('en-US', { | ||||||||||||
| month: 'short', | ||||||||||||
| day: '2-digit', | ||||||||||||
| year: 'numeric', | ||||||||||||
| }).format(parsed); | ||||||||||||
| } | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintentional character-class range in
ISO_DATE_REGEXThe character class
[0-9:.+-Z]contains an unintended ASCII range. In a regex character class, a bare-between two characters creates a range. Here+is ASCII 43 andZis ASCII 90, so+-Zmatches all characters from ASCII 43–90 — including,,/,;,<,=,>,?,@, and all uppercase letters A–Y. The intent is clearly to match ISO 8601 time-segment characters (digits, colon, period, plus, hyphen, and the literalZ). The hyphen must either be escaped or placed at the start/end of the class to be treated as a literal.