-
Notifications
You must be signed in to change notification settings - Fork 372
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
Added new directive: day with suffix #463
base: main
Are you sure you want to change the base?
Conversation
These type of numbers are called ordinals, so I prefer to use that terminology when possible. Since ordinals can come with a suffix or without in written form, this can still be somewhat confusing, but from a maintenance point of view, I'd like to clarify things in here by saying "ordinal suffix" rather than "day suffix", since the latter isn't clear to me what it means on first read. Rather than add a new directive for this though, I think it may make more sense to add it as a flag (i.e. if the current directive is represented by an ordinal number, require the suffix in printed form - if the current directive is not an ordinal number, then the flag is invalid, and either ignored or results in an error). This means we can easily add it to both the default and strftime formats by introducing a corresponding flag, and would support arbitrary ordinals with suffixes (e.g. if you wanted a format that says something like "the 10th hour of the 3rd day of March" or something like that). I haven't yet thought through what the flag would be in the two formats, but let's discuss the approach first, and we can hash that out. |
I tried to use the code in this PR and noticed issues with some numbers. I eventually rewrote it like this:
With tests:
I am making the assumption there is never more than 31 days. Thanks for the helpful library. |
Hello there 👋 What's the latest with this PR? It's a couple of years old now, but if it's still a desired feature I'd be happy to do further work on it. |
I just came across this attempting to create a label for some graphs I'm making. I'd be happy to pick up the work on this rather than, effectively, rewriting it in my codebase. |
Summary of changes
Addressed issue described in #426
Checklist