-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Leo concise levels2 #17977
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
Leo concise levels2 #17977
Conversation
|
Example in #17958 gives (I used autofmt_xdate to not have overlap) It corresponds to
|
Zooming in to have only one year shows the offset:
Note how the first tick is labelled with the month even if the day is also non zero, ensuring no ambiguity. |
Zooming in some more show the small struggle with good defaults to resolve hour:minute vs minute:second ambiguity (and my current attempt, using hour
|
zooming in more and handling the edge corner when first tick and offset share a zero at
|
Old level code removing trailing zeroes is now broken (it was already kind of hackish).
|
@jklymak any feedback? |
I think at this point, this is a new Formatter, which is great. I think it'd be nice if we had an easy way for folks to plug their own formatters in as default w/o the 4-line song and dance. However, if you write your own little (one-file) package, you can register the formatter at import time. |
I'm going to close this - it is simply a different formatter than ConciseDateFormatter, and its advantages are not clear. In general I strongly prefer what is done in ConciseDateFormatter, so unless there is a groundswell to replace it, I think this alternative should be its own package. |
PR Summary
Similar to #17971 but is able to write multiple levels when needed solving issues like #17958
It changes the user API though (format strings for zeros and offset are replaced by unit formatting and separator strings).
PR Checklist