-
Notifications
You must be signed in to change notification settings - Fork 542
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
Please add weekday as unambiguous single letter abbreviation: MTWRFSU (capitalized) #936
Comments
Is this style a part of other popular tools (like Unix' |
Not done any extensive benchmarking as I don't see much value in being stuck in the bad designs of the past, but from some googling I've found that on a Mac https://en.wikipedia.org/wiki/Pmset has it (and some unsourced claims that it's "They seem universal to academia" in this wiki vital article) I also use it in this great iStat Menus GUI app showing a calendar in your menu bar, where dense representation is paramount, so it looks like so in the menu: So it would be great if I could also use these design improvements in the infamous land of poor design :) — cli tools — that use this library to parse user input and format date output
That's most likely because you're used to non-unique abbreviations |
Interesting to learn about the As I understand it the use is rare and mostly in tables to indicate something happens on multiples days that week. Is there also common use for the letters as part of formatting a date? That said, chrono does not have to support every odd convention under the sun. Ans it is not especially hard to to implement this manually outside chrono: let mtwrfsu = ['M', 'T', 'W', 'R', 'F', 'S', 'U'];
println!("{}", mtwrfsu[date.weekday().num_days_from_monday() as usize]); It would be a cool example to add to |
or to indicate something happens on a single day, but without having to spell it out like in file managers or cli
and what do you implement if you're a consumer of a cli tool that uses this library (and doesn't add any text filters)? That's the power of defaults - they flow downstream
Sure, but before supporting every maybe there could be a support of any? There is currently no dense unique representation |
Thank you for replying this quickly! I have also seen your issue in lsd-rs/lsd#793. And I think it is cool. I've had my share of projects that try to squeeze every last byte out of some file, or make use of every tiny pixel.
We don't really have defaults when it comes to formatting. Well, there are the ISO 8601, RFC 3339 and RFC 2822 formats. But otherwise it is up to the applications that use chrono. They can format the date however they like.
There is, but it is numeric 😄. Chrono has declined features in the past because they would not be generally useful enough. |
https://docs.rs/chrono/latest/chrono/format/strftime/index.html these are what I meant by defaults
😄
Sure they can do anything and I wish there were more basic composable elements everywhere so that users can have the flexibility to format output however they like, but then it's much easier to use the "defaults" and expose them downstream, hence why these "defaults" are valuable, and why sticking with some clunky strftime convention has wider negative consequences (#19)
Or Chrono could show those projects how to do design better! That's part of the role of specialized libraries - to the be source of better practices within that specialized domain |
Sorry, this isn't going to happen for now. I think the convention is not popular enough to support from within chrono, and all other things being equal I'd rather keep chrono smaller rather than add all functionality anyone asks for. |
Three letters is too much space to convey that info in some of the dense table layouts
The text was updated successfully, but these errors were encountered: