allow %d and %m to take either 1 or 2 characters, e.g. 03/04/1999 or 3/4/1999 #160
+22
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem seems that dates like 1/5/1999 are not read with
format "%m/%d/%Y", because 01/05/1999 is expected. I think
that if you read ?strptime well, this is correct, but then base
R works differently and accepts single digit days and months. So,
I think the prefered behavior is to accept them.
This PR is messy and full with print statements. I believe that the
line marked with "need to set back the parser iterator/pointer one
character here?" should be replaced with setting back the parser
pointer one step, as we have a fail read here which does NOT raise
an error. The error then happens in next step, when the "/" (or other
separator) has been absorbed, I suspect. Happy to revisit this when
I know how the parser works. Please ignore otherwise.