R/functions_helpers.R

Defines functions .validate_fecha

Documented in .validate_fecha

# Helper Functions ---------------------------

#' @title Helper: Date validation
#'
#' @description
#' \Sexpr[results=rd, stage=render]{lifecycle::badge("questioning")}
#' Validate date
#'
#' @param date Date
#' @return TRUE if date has a correct format.
.validate_fecha <- function(date) {
  tryCatch({!is.na(format.Date(x = date, "%Y-%m-%d"))}, error = function(e) {FALSE})
}

Try the rRofex package in your browser

Any scripts or data that you put into this service are public.

rRofex documentation built on Aug. 2, 2021, 9:06 a.m.