reconhub / aweek

Convert dates to arbitrary week definitions :calendar:
https://www.repidemicsconsortium.org/aweek
Other
17 stars 4 forks source link

Error if character dates are non-ISO format OR user doesn't specify format #4

Closed zkamvar closed 5 years ago

zkamvar commented 5 years ago

This addresses #2 by only allowing ISO 8601 format dates to pass through if the user doesn't specify format:

library(aweek)
date2week("1984/11/24")
#> <aweek start: Monday>
#> [1] "1984-W47-6"
date2week("11/24/1984")
#> Error in date2week("11/24/1984"): Not all dates are in ISO 8601 standard format (yyyy-mm-dd). The first incorrect date is 11/24/1984
date2week("11/24/1984", format = "%m/%d/%Y")
#> <aweek start: Monday>
#> [1] "1984-W47-6"

Created on 2019-03-07 by the reprex package (v0.2.1)

Things left to do: