-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add padding size to Pad::Zero or Pad::Space #1663
Comments
|
Ahh I missed that. Can you imagine a way to attach the padding width to the Item::Numeric enum without breaking the public API? |
Well, |
Hmmm. We could add something like enum Numeric {
//...
Padded { numeric: Numeric, pad_count: usize }
} But that's a hack. Should I make a proposal or should we wait for 1.0 to add it to the Pad enum. |
I guess we could try whether we can make |
Hmm, so what are the implications for dependent code:
So it seams if we go the What is your experience / opinion here? Did i miss something? |
I don't understand the way you wrote this up. |
To sum it up. I'm not sure if the additional complexity of more |
Okay, I did a code search and I don't think we can make I don't know when chrono 0.5 will be released, but I know it won't happen in the near future, so I don't think waiting for a semver-incompatible release is a good option. |
Ok. I'll make a proposal. |
The uu_date command in coreutils uses chrono to parse the format string. In #7334 there is a report that it is needed to add the amount of padding to the format string.
current behavior
let format_items = StrftimeItems::new("+%03d");
will yield Item::Error.expected behavior
let format_items = StrftimeItems::new("+%03d");
should yield Item::Numeric(Numeric::Day, Pad::Zero(3)).And in
format_numeric()
replace the hard coded 1 char padding to the value in Pad::Space or Pad::Zero.The text was updated successfully, but these errors were encountered: