fmt icon indicating copy to clipboard operation
fmt copied to clipboard

Add support for alternative month format

Open Iamnotagenius opened this issue 1 year ago • 2 comments

In ru_RU.UTF-8 locale, there's a possibility to specify alternative month format. For example, specifying %B format, strftime will output this (providing that said locale is in charge): марта. It works well in scenarios like %d %B, which will result in 31 марта. However, strftime has support for %OB which will output Март with the russian locale. This will be more appropriate to use in formats like %OB %Y which results in Март 2024. It seems this functionality is not at all present in this library, when I try to format a date like %OB the library throws an invalid format exception.

Iamnotagenius avatar Mar 31 '24 00:03 Iamnotagenius

%OB seems non-standard: https://eel.is/c++draft/tab:time.format.spec. Where is it documented?

vitaut avatar Mar 31 '24 22:03 vitaut

Some discussions about standardizing this in C: https://www.austingroupbugs.net/view.php?id=1166 https://www.austingroupbugs.net/view.php?id=258

jmkuhn avatar Apr 29 '24 18:04 jmkuhn

Closing as there doesn't seem to be much interest but a PR would still be welcome.

vitaut avatar Aug 28 '24 14:08 vitaut