R/utils-date-processing.R

Defines functions ukc_date_processing

ukc_date_processing <- function(date) {
  if (is.null(date)) {
    date_query <- NULL
  } else {
    if (nchar(as.character(date)) > 7) {
      date <- substr(as.Date(date), 1, 7)
    }

    date_query <- paste0("&date=", date)
  }

  date_query
}

Try the ukpolice package in your browser

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

ukpolice documentation built on Aug. 3, 2020, 5:09 p.m.