Skip to content

fix(dates): enforce 'en-US' locale for date formatting in rss.ts and repoSpotlight.ts - #9017

Open
ChetanSenta wants to merge 2 commits into
JhaSourav07:mainfrom
ChetanSenta:fix/pin-locale-date-formatting
Open

fix(dates): enforce 'en-US' locale for date formatting in rss.ts and repoSpotlight.ts#9017
ChetanSenta wants to merge 2 commits into
JhaSourav07:mainfrom
ChetanSenta:fix/pin-locale-date-formatting

Conversation

@ChetanSenta

Copy link
Copy Markdown
Contributor

Description

Fixes #9015

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other

What this PR does

lib/rss.ts and lib/svg/repoSpotlight.ts both called
toLocaleDateString(undefined, ...), letting the server's ambient
runtime locale determine the date format baked into the generated SVG
badge — a real risk given how commonly minimal Node.js Docker builds
ship reduced ICU data. lib/github.ts's joinedDate formatting already
correctly pins this to 'en-US' — applied the same fix to the two
outliers.

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have made sure that I have only one commit to merge in this PR.

…ight.ts, matching the existing pattern in lib/github.ts
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request addresses issue #9015 by pinning the date formatting to the 'en-US' locale in two files, which helps avoid potential inconsistencies in date representation due to varying server locales. This approach is similar to previous decisions made regarding badge URL extraction logic, where consistency and reliability were prioritized. Thank you for your contribution!

@retenta-bot retenta-bot Bot changed the title fix(dates): pin explicit 'en-US' locale in rss.ts and repoSpotlight.ts date formatting, previously undefined/ambient fix(dates): enforce 'en-US' locale for date formatting in rss.ts and repoSpotlight.ts Aug 13, 2026
@Aamod007 Aamod007 added mentor:Aamod007 type:bug Something isn't working as expected level:beginner Small changes Usually isolated fixes or simple UI/text updates. labels Aug 13, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for pinning the locale to 'en-US'\ in \lib/rss.ts\ and
epoSpotlight.ts\ is absolutely correct and a great catch to ensure deterministic SVG generation regardless of the server's ambient locale!

However, it looks like this PR unintentionally reverts the recent timezone testing fix from PR #8994 in \utils/dateHelpers.test.ts. You re-added the 'Z'\ to the test timestamps, which will cause those tests to fail or act inconsistently in non-UTC environments again.

Could you please revert the changes to \utils/dateHelpers.test.ts\ so we keep the timezone fix intact? Once that's removed, I'll be happy to approve this!

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 5004.32 KB 5004.32 KB 0 B
Total CSS 354.80 KB 354.80 KB 0 B

@ChetanSenta
ChetanSenta requested a review from Aamod007 August 13, 2026 16:50
@Aamod007 Aamod007 added the quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. label Aug 13, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for resolving the regression on the timestamp strings in \dateHelpers.test.ts! The fix for pinning the locale to \en-US\ is a very solid consistency improvement for the SVGs across different Node.js execution environments.

Approved!

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Hey @ChetanSenta, this pull request has been inactive for 3 days. It will be automatically closed in 2 days if no further activity occurs.

If you are still working on this, please push your latest changes or leave a comment to keep it active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:needs-rebase level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

3 participants