Are the given dates in the same minute (and hour and day)?
Are the given dates in the same minute (and hour and day)?
// CommonJS
var isSameMinute = require('date-fns/isSameMinute')
// ES 2015 import isSameMinute from 'date-fns/isSameMinute'
// ESM
import { isSameMinute } from 'date-fns'
isSameMinute(dateLeft, dateRight)
| Name | Description |
|---|---|
dateLeft |
the first date to check |
dateRight |
the second date to check |
| Description |
|---|
|
the dates are in the same minute (and hour and day) |
| Type | Description |
|---|---|
TypeError |
2 arguments required |
// Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 in the same minute? const result = isSameMinute( new Date(2014, 8, 4, 6, 30), new Date(2014, 8, 4, 6, 30, 15) ) //=> true
// Are 4 September 2014 06:30:00 and 5 September 2014 06:30:00 in the same minute? const result = isSameMinute( new Date(2014, 8, 4, 6, 30), new Date(2014, 8, 5, 6, 30) ) //=> false
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isSameMinute