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 time.Format to format dates. It allows dates to be localized. #537

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

cbrunet
Copy link
Contributor

@cbrunet cbrunet commented Apr 10, 2022

No description provided.

@netlify
Copy link

netlify bot commented Apr 10, 2022

Deploy Preview for gohugo-ananke-theme-demo canceled.

Name Link
🔨 Latest commit 097a084
🔍 Latest deploy log https://app.netlify.com/sites/gohugo-ananke-theme-demo/deploys/625615cad8c7bf0008ad4505

Copy link
Member

@regisphilibert regisphilibert left a comment

Choose a reason for hiding this comment

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

Hi @cbrunet and thank you for this great initiative.

One tiny issue is that currently Ananke can be used down to Hugo 0.64.0, while there are discussion to move up the minimum version it might not be as far as 0.87.0 which is the version needed for your feature to be enabled. Could you add a test for ge hugo.Version "0.87.0" before using :date_full as a format?

Again, thanks a ton!

@cbrunet
Copy link
Contributor Author

cbrunet commented Apr 12, 2022

Can I just keep the original date format string? I think this should be compatible with older Hugo version, while allowing the user to provide a predefined layout when using a more recent version of Hugo.

@regisphilibert
Copy link
Member

Can I just keep the original date format string?

Yes of course! Can you confirm I understand right: That the default would remain "January 2, 2006" as before, and user would be informed to set :date_full in the theme's date_format params to benefit from new localized dates?

@regisphilibert regisphilibert merged commit 5520ed1 into theNewDynamic:master Apr 21, 2022
tstephen pushed a commit to tstephen/gohugo-theme-ananke that referenced this pull request Jun 9, 2022
…eNewDynamic#537)

* use time.Format to format dates. It allows dates to be localized.

* Keep old default format, to remain compatible with older versions of hugo
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