isToday()function
isToday(target: PossibleDate, current?: PossibleDate, caller: AnyCaller = isToday): boolean
| Param | Type | |
|---|---|---|
target | PossibleDate | Date to test. required |
current | PossibleDate | Date to test against (defaults to now). |
caller | AnyCaller |
| Return | |
|---|---|
boolean | true if target falls on the same calendar day as current. |
| Throws | |
|---|---|
RequiredError | If target or current cannot be converted to a valid date. |
Is a date today (taking into account midnight).
Examples
isToday(new Date()) // true