R/check_date.R
check_date.Rd
This function checks if the input date has the format "YYYY-MM-DD".
date
"YYYY-MM-DD"
check_date(date)
[character(1)] The date in format "YYYY-MM-DD".
character(1)
as.Date(date) if date has the format "YYYY-MM-DD". Otherwise, the function throws an error.
as.Date(date)
Other date helpers: find_closest_year()
find_closest_year()
check_date(date = "2000-01-01") #> [1] "2000-01-01"