fix(dates): enforce 'en-US' locale for date formatting in rss.ts and repoSpotlight.ts - #9017
fix(dates): enforce 'en-US' locale for date formatting in rss.ts and repoSpotlight.ts#9017ChetanSenta wants to merge 2 commits into
Conversation
…ight.ts, matching the existing pattern in lib/github.ts
|
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. |
|
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! |
Aamod007
left a comment
There was a problem hiding this comment.
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!
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
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!
|
If you are still working on this, please push your latest changes or leave a comment to keep it active. |
Description
Fixes #9015
Pillar
What this PR does
lib/rss.tsandlib/svg/repoSpotlight.tsboth calledtoLocaleDateString(undefined, ...), letting the server's ambientruntime 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'sjoinedDateformatting alreadycorrectly pins this to
'en-US'— applied the same fix to the twooutliers.
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors.