isPast()function

isPast(target: PossibleDate, current?: PossibleDate, caller: AnyCaller = isPast): boolean
ParamType
targetPossibleDate
Date to test. required
currentPossibleDate
Date to test against (defaults to now).
callerAnyCaller
Function to attribute a thrown error to (defaults to isPast itself). Defaults to isPast
Return
boolean
true if target is before current.
Throws
RequiredError
If target or current cannot be converted to a valid date.

Is a date in the past?

Examples

isPast("2000-01-01") // true