Checks whether an object is a Date or can be safely coerced to a Date
using base::as.Date(). If the input is coercible, it is returned
invisibly; otherwise, an informative error is thrown.
Value
x invisibly if it is a Date or coercible to one. An error is thrown if
coercion fails.
Details
This helper is intended for lightweight validation in functions that accept
date inputs but do not need to modify them. Coercion is attempted via
base::as.Date(), and failure results in a call to
chk::abort_chk().
See also
base::as.Date(), chk::abort_chk()
Other chk:
ngr_chk_dt_complete()