 min
Returns the earliest of the given dates.
Description
Returns the earliest of the given dates.

Usage
// CommonJS
var min = require('date-fns/min')
// ES 2015
import min from 'date-fns/min'
// ESM
import { min } from 'date-fns'
Syntax
min(datesArray)
Arguments


Name
Description


datesArray
the dates to compare



Returns


Description



the earliest of the dates




Exceptions


Type
Description


TypeError
1 argument required



Examples
// 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


                
{'path': 'public/docs/date_fns/min.html', 'source': 'DevDocs.IO'}