Skip to content

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

@georgpfolz

Description

@georgpfolz
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions