Skip to contents

Is it a date range?

Usage

is_date_range(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for two ISO or US dates joined by to/-.

Examples

is_date_range(c("07/21/16 to 08/19/16", "1972-01-01 - 1972-07-01", NA))
#> [1] TRUE TRUE   NA