Closed jonocodes closed 11 months ago
As an example there should be a way to produce a month/day formatted date in accordance with locale.
en = October 12 de = 12. Oktober
Django handles this using additional localized formatters: https://github.com/django/django/blob/main/django/conf/locale/de/formats.py
In this case it would be using the MONTH_DAY_FORMAT, but the other ones would be good as well.
And here is how shuup does it: https://github.com/shuup/shuup/blob/25f78cfe370109b9885b903e503faac295c7b7f2/shuup/utils/dates.py#L41
It supports fewer formats, but does mention following CLDR.
Heh, I think I wrote that bit in Shuup back in the day. 😁
Anyway, have you tried format_skeleton with the MMMd skeleton? Does it do what you want?
format_skeleton
MMMd
Ah yes, that does what I need. Thanks!
Overview Description
As an example there should be a way to produce a month/day formatted date in accordance with locale.
en = October 12 de = 12. Oktober
Django handles this using additional localized formatters: https://github.com/django/django/blob/main/django/conf/locale/de/formats.py
In this case it would be using the MONTH_DAY_FORMAT, but the other ones would be good as well.
And here is how shuup does it: https://github.com/shuup/shuup/blob/25f78cfe370109b9885b903e503faac295c7b7f2/shuup/utils/dates.py#L41
It supports fewer formats, but does mention following CLDR.