Is the given date in the same minute as the current date?
Is the given date in the same minute as the current date?
⚠️ 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 isThisMinute = require('date-fns/isThisMinute')
// ES 2015 import isThisMinute from 'date-fns/isThisMinute'
// ESM
import { isThisMinute } from 'date-fns'
isThisMinute(date)
| Name | Description |
|---|---|
date |
the date to check |
| Description |
|---|
|
the date is in this minute |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// If now is 25 September 2014 18:30:15.500, // is 25 September 2014 18:30:00 in this minute? const result = isThisMinute(new Date(2014, 8, 25, 18, 30)) //=> true
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isThisMinute