Is the given date in the past?
Is the given date in the past?
⚠️ Please note that this function is not present in the FP submodule as it uses
Date.now()internally hence impure and can't be safely curried.
// CommonJS
var isPast = require('date-fns/isPast')
// ES 2015 import isPast from 'date-fns/isPast'
// ESM
import { isPast } from 'date-fns'
isPast(date)
| Name | Description |
|---|---|
date |
the date to check |
| Description |
|---|
|
the date is in the past |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// If today is 6 October 2014, is 2 July 2014 in the past? const result = isPast(new Date(2014, 6, 2)) //=> true
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isPast