R/check.R

Defines functions check_date check_format

check_format <- function(x) {
  match.arg(x, choices = c('json', 'xml'))
}

check_date <- function(date) {
  if (is.null(date)) return(NULL)
  if (is.character(date)) {
    if (nchar(date) == 10) {
      date <- paste0(date, 'T00:00:00Z')
    }
  }
  date
}

Try the congress package in your browser

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

congress documentation built on May 29, 2024, 2:37 a.m.