Skip to content

feat(i18n): Localize date and time formatting based on user's language#343

Open
hakonharnes wants to merge 4 commits intocgoinglove:mainfrom
hakonharnes:feat/i18n-localized-date-formatting
Open

feat(i18n): Localize date and time formatting based on user's language#343
hakonharnes wants to merge 4 commits intocgoinglove:mainfrom
hakonharnes:feat/i18n-localized-date-formatting

Conversation

@hakonharnes
Copy link
Contributor

@hakonharnes hakonharnes commented Dec 3, 2025

Relates issue: #340 (partially solves it).

Summary

  • Dates and times now display in the user's selected language instead of always showing in English
  • Relative times (e.g., "2 hours ago") are also localized (e.g., "for 2 timer siden" in Norwegian)

Changes

  • Added global date/time formats (short, long, shortWithTime) in src/i18n/request.ts
  • Replaced date-fns formatting with next-intl's useFormatter (client) and getFormatter (server)
  • Updated relevant components.

Example: Long dates
image
image

Example: Short dates

image image

Example: Relative dates

image image image

@vercel
Copy link

vercel bot commented Dec 3, 2025

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

A member of the Team first needs to authorize it.

@hakonharnes hakonharnes force-pushed the feat/i18n-localized-date-formatting branch from 78b7d1d to 0d35413 Compare January 21, 2026 22:46
hakonharnes added a commit to hakonharnes/better-chatbot that referenced this pull request Jan 22, 2026
@brrock brrock requested a review from cgoinglove January 31, 2026 19:06
Copy link
Collaborator

@brrock brrock left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants