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

differentiate between locales en-us and en-gb #724

Closed
2 tasks done
georgpfolz opened this issue Jul 21, 2023 · 1 comment
Closed
2 tasks done

differentiate between locales en-us and en-gb #724

georgpfolz opened this issue Jul 21, 2023 · 1 comment

Comments

@georgpfolz
Copy link

georgpfolz commented Jul 21, 2023

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I love the localized formats! But the English outputs for en are US-American formats (concerning the order of day and month). It would be great to be able to specify en-gb to get more European results:

now = pendulum.now()
now.format('LLLL', locale='en')  → Thursday, September 4 1986 8:30 PM
now.format('LLLL', locale='en-us')  → Thursday, September 4 1986 8:30 PM
now.format('LLLL', locale='en-gb') → Thursday, 4 September 1986 8:30 PM

What I also miss is a localized format token that returns just the day and the month (maybe LL-?), so that it's easily combined with other tokens in a format string:

now.format('LL-', locale='en-gb') → 4 September
now.format('LL-', locale='en-us') → September 4
now.format('dddd, LL- LT', locale='en-gb') → Thursday, 4 September 8:30 PM
@Secrus
Copy link
Collaborator

Secrus commented Aug 15, 2023

Done in #731

@Secrus Secrus closed this as completed Aug 15, 2023
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

No branches or pull requests

2 participants