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