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

Add date localization formating in config.yml #241

Closed
wants to merge 3 commits into from

Conversation

nikurasutan
Copy link

My goal was to localize the date format so that on non-english websites all written Months and Days are replaced with the correct terms for the country. I wasn't yet able to get this working, but I will share, what I've achieved so far. But I will keep working on it.

Nikurasu and others added 3 commits October 17, 2020 21:12
It's now possible to format the date in the config.yml. More informations in the updated readme.
Fixed misspelling in readme
@sylhare
Copy link
Owner

sylhare commented Oct 19, 2020

Alright let me know how it goes, I would like to see in a screenshot how different it appears from one format to another.
I like documentation on the formats:

There are different shorthand formats you can use:

  • %Y: Year with century, if provided, will pad result at least 4 digits, e.g. 0000, 0001, 1995, 2009, 14292
  • %C: year /100 (rounded down such as 20 in 2009)
  • %y: year % 100 (00 ... 99)
  • %m: Month of the year, zero padded (01 ... 12)
    • %_m: blank-padded ( 1 ... 12)
    • %-m: no-padded (1 ... 12)
  • %B: Full month name (January)
  • %b: The abbreviated month name (Jan)
  • %h: Equivalent to %b
  • %d: Day of the month, zero padded (01 ... 31)
    • %-d: no padded (1 ... 31)
  • %e: Day of the month, blank padded ( 1 ... 31)
  • %j: Day of the Year (001 ... 366)
  • %A: Full day of the week (Sunday)
  • %a: Abbreviated day of the week (Sun)
  • %D: Date (Short for '%M/%d/%y')
  • %F: The ISO 8601 date format '%Y-%m-%d'

That should be all relevant shorthands for your blog, but you can finde a full list here

@sylhare sylhare changed the title I added date formating in config.yml Add date localization formating in config.yml Oct 20, 2020
@sylhare
Copy link
Owner

sylhare commented Oct 20, 2020

I can convert this pull request to "draft" until it's ready if you want @NikurasuKun
So that it stays there and you can continue working on it 👍

@sylhare sylhare marked this pull request as draft November 1, 2020 15:04
@nikurasutan
Copy link
Author

Ok, I tried it in my holdays, but I don't get it working, sorry the formating is the most I can achieve.

@sylhare
Copy link
Owner

sylhare commented Nov 3, 2020

Alright, I will take a look

OMEGA-Y pushed a commit to OMEGA-Y/OMEGA-Y.github.io that referenced this pull request Dec 8, 2020
* fix broken link

* fix broken link
@danisztls
Copy link
Contributor

I made a PR with localization for months. The same logic can be applied to the days of the week.

@sylhare sylhare mentioned this pull request Feb 18, 2021
sylhare added a commit that referenced this pull request Feb 19, 2021
@sylhare
Copy link
Owner

sylhare commented Feb 19, 2021

I believe the localization was mainly for the month. In term of date formatting, that's another subject.
So I will close this PR as I consider it implemented.

@sylhare sylhare closed this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants