[Bug libc/10547] strftime Feature Request - day of month as 1st, 2nd, 3rd...

digitalfreak at lingonborough dot com sourceware-bugzilla@sourceware.org
Thu Apr 13 23:40:00 GMT 2017


https://sourceware.org/bugzilla/show_bug.cgi?id=10547

Rafal Luzynski <digitalfreak at lingonborough dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |digitalfreak@lingonborough.
                   |                            |com

--- Comment #2 from Rafal Luzynski <digitalfreak at lingonborough dot com> ---
I suggest reopening this bug instead of filing a similar one which I was going
to do.

As suggested in this bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=768192 there is a broader need for
another way to format the day of the month.  I hesitate to use the word
"alternative" because someone might say that the alternative format specifiers
already exist, for example "%Od" (this is for alternative digits, for example
Roman or Eastern Arabic, also alternative digits are for all numeric outputs,
not just days) or "%Ed" (unsupported, I'm not sure what would it mean).  The
output would be:

- the ordinal day number as required in English (1st, 2nd, …) or Friulian (1ⁿ,
2, 3,…) or maybe in more languages,
- optionally preceded by a required preposition (Friulian: al 1ⁿ, ai 2, ai 3…),
- or anything else, as required by specific locales.

Other languages would output a regular decimal number, or would rather not use
this new format specifier.

Browsing the stftime(3) man page I can see that the nearest unused format
specifier is "%f".  So, for example:

- "%B %f" would output "April 14th" (or "April 1st") in English;
- "%f di %B" would output "ai 14 di Avrîl (or "al 1ⁿ di Avrîl) in Friulian.

A similar solution is here: https://github.com/samsonjs/strftime and it
introduces "%o" but says explicitly that it outputs ordinal numbers (while here
I say it can be ordinal or anything else, as required by a specific language)
and it is implemented for English only.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list