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)
  }
}
r-hub/cranlogs documentation built on Nov. 28, 2020, 6:38 p.m.