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 hugo function to support localization #20

Merged
merged 6 commits into from
Mar 31, 2023

Conversation

ColinMaudry
Copy link
Contributor

@ColinMaudry ColinMaudry commented Mar 31, 2023

https://gohugo.io/functions/dateformat/

What problem does this PR solve?

Dates are not formatted according the the language locale specified in config.toml. It sticks to English.

Is this PR adding a new feature?

Sort of: now people can choose to display dates according to the language they want (defaultContentLanguage config).

Is this PR related to any issue or discussion?

Nope

PR Checklist

  • I have verified that the code works as described/as intended.
    • It does, but I didn't find a way to format dates UK style, only US style 😕 (15 Feb 2022 vs. Feb 15, 2022) fixed in config
  • This change adds a social icon which has a permissive license to use it.
  • This change does not include any external library/resources.
  • This change does not include any unrelated scripts (e.g. bash and python scripts).
  • I have enabled maintainer edits for this PR.

@netlify
Copy link

netlify bot commented Mar 31, 2023

Deploy Preview for endearing-frangollo-e7abce ready!

Name Link
🔨 Latest commit 3566ad3
🔍 Latest deploy log https://app.netlify.com/sites/endearing-frangollo-e7abce/deploys/6426fa477a47f60008356ec3
😎 Deploy Preview https://deploy-preview-20--endearing-frangollo-e7abce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ColinMaudry ColinMaudry marked this pull request as ready for review March 31, 2023 15:02
@hugo-sid
Copy link
Owner

hugo-sid commented Mar 31, 2023

Hi Colin.

Thanks a lot for contributing to this theme.

I appreciate your efforts to improve this theme.

I consider formatting dates as per language locale as an important feature.

The Netlify preview associated with this PR is old one. Meaning the preview was built, at the time when you opened a draft PR.

The Netlify preview seems to be most recent one.

Copy link
Owner

@hugo-sid hugo-sid left a comment

Choose a reason for hiding this comment

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

Looks great @ColinMaudry !

@hugo-sid hugo-sid merged commit 64195d2 into hugo-sid:main Mar 31, 2023
@ColinMaudry ColinMaudry deleted the patch-1 branch April 1, 2023 08:28
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.

None yet

2 participants