Skip to content
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

Use dateFormat function to render localized dates #355

Merged
merged 1 commit into from
Sep 3, 2023
Merged

Use dateFormat function to render localized dates #355

merged 1 commit into from
Sep 3, 2023

Conversation

stefanoginobili
Copy link
Contributor

This PR fixes the date not being rendered honoring the content localization.

🪲 Found bug

The dates were rendered using the .Format function which does not follow the content localization.
Example: the date 2023-06-07 was rendered as "7 June 2023" inside an Italian content.

✅ Applied fix

The fix replaces the .Format function with the dateFormat one, which respects the page localization. Going on with the example above, the Italian content now renders the same date as "7 giugno 2023" which is the expected output.

@vercel
Copy link

vercel bot commented Sep 2, 2023

@stefanoginobili is attempting to deploy a commit to the FixIt Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Sep 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fixit ❌ Failed (Inspect) Sep 3, 2023 3:57am

@Lruihao Lruihao added the bug Something isn't working label Sep 3, 2023
@Lruihao Lruihao added this to the v0.2.18 milestone Sep 3, 2023
@Lruihao Lruihao self-assigned this Sep 3, 2023
@Lruihao Lruihao changed the base branch from dev to dates-localization September 3, 2023 04:06
@Lruihao Lruihao self-requested a review September 3, 2023 04:06
Copy link
Member

@Lruihao Lruihao left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, Grazie!

@Lruihao Lruihao merged commit b72ffce into hugo-fixit:dates-localization Sep 3, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants