assertthat icon indicating copy to clipboard operation
assertthat copied to clipboard

error with assertthat::is.date()

Open usrbinr opened this issue 2 years ago • 0 comments

hi!

For some reason the assertthat function is.date() will return TRUE for non date functions in certain situations.

Is this the intended functionality of the function?


# not a real date , this will return NA  
  fake_date <- lubridate::ymd("2021-13-01")

# however this will return TRUE when passing through is.date()
  assertthat::is.date(fake_date)

Is there a way to use assert that function to validate an object is date time format?

usrbinr avatar Nov 24 '23 23:11 usrbinr