Returns the earliest of the given dates.
Returns the earliest of the given dates.
// CommonJS
var min = require('date-fns/min')
// ES 2015 import min from 'date-fns/min'
// ESM
import { min } from 'date-fns'
min(datesArray)
| Name | Description |
|---|---|
datesArray |
the dates to compare |
| Description |
|---|
|
| Type | Description |
|---|---|
TypeError |
1 argument required |
// Which of these dates is the earliest? const result = min([ new Date(1989, 6, 10), new Date(1987, 1, 11), new Date(1995, 6, 2), new Date(1990, 0, 1) ]) //=> Wed Feb 11 1987 00:00:00
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/min