Is the given date in the future?
Is the given date in the future?
⚠️ 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 isFuture = require('date-fns/isFuture')
// ES 2015 import isFuture from 'date-fns/isFuture'
// ESM
import { isFuture } from 'date-fns'
isFuture(date)
| Name | Description |
|---|---|
date |
the date to check |
| Description |
|---|
|
the date is in the future |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// If today is 6 October 2014, is 31 December 2014 in the future? const result = isFuture(new Date(2014, 11, 31)) //=> true
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isFuture