Closed CarlijnB closed 1 year ago
This is complicated: while there are a limited number of "date components" (prefixed by %), readr accepts any additional combination of characters, as "Any other character [not part of a date component] is matched exactly". I don't think there's a way of testing whether date formats make sense (e.g. writing to a specific format). Extended test to grepl("%(Y|y|m|b|B|AD|D|F|x|s)|^$",""), to allow for a year being added as characters rather than %Y or %y
Date format testing in these options currently works by identifying whether the strings include any of "%(Y|y|AD|D|F|x|s)|^$". This is only approximate.
Probably better to replace with a try_catch() around some readr date-reading function.