R/utils.R

Defines functions check_date

check_date <- function(string) {
  if(is.na(as.Date(string, format = "%Y-%m-%d"))){
    stop(paste0("The date '", string, "' is not yyyy-mm-dd formatted."),
         call. = FALSE)
  }
}
metacran/cranlogs documentation built on Nov. 30, 2020, 8:13 a.m.