Is the first date after the second one?
Is the first date after the second one?
// CommonJS
var isAfter = require('date-fns/isAfter')
// ES 2015 import isAfter from 'date-fns/isAfter'
// ESM
import { isAfter } from 'date-fns'
isAfter(date, dateToCompare)
| Name | Description |
|---|---|
date |
the date that should be after the other one to return true |
dateToCompare |
the date to compare with |
| Description |
|---|
|
the first date is after the second date |
| Type | Description |
|---|---|
TypeError |
2 arguments required |
// Is 10 July 1989 after 11 February 1987? const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) //=> true
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isAfter