-
Notifications
You must be signed in to change notification settings - Fork 103
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
Feature: optional padding #365
Comments
Fair. We should either provide a better way to do it or at least make this code behave optimally (which is doable). Some arguments against adding
alternativeParsing({
year(Padding.NONE); char('-'); monthNumber(Padding.NONE); char('-'); dayOfMonth(Padding.NONE)
}) {
year(); char('-'); monthNumber(); char('-'); dayOfMonth()
}
Let's collect more feedback and see how widespread the problem is. Everyone, please don't hesitate to share the ugly code that you're forced to write. Maybe we'll help you improve it, or maybe we'll see that |
Will it parse something like But I agree, that reusing for both formatting and parsing is not a common case. |
Yes.
It does. We'll include this in the documentation, this information is missing. |
Padding class now suggests only strict options. You either have NONE or ZERO or SPACE. Same for formating and parsing.
It looks like a common usecase to have a flexible parser but strict formatted.
This can be implemented now as
But this is quite verbose and probably suboptimal. I suggest to add Padding.OPTIONAL_ZERO and maybe something else similar. to fix it.
The text was updated successfully, but these errors were encountered: