Is the given date exists?
Checks if the given arguments convert to an existing date.
// CommonJS
var isExists = require('date-fns/isExists')
// ES 2015 import isExists from 'date-fns/isExists'
// ESM
import { isExists } from 'date-fns'
isExists(year, month, day)
| Name | Description |
|---|---|
year |
of the date to check |
month |
of the date to check |
day |
of the date to check |
| Description |
|---|
|
the date exists |
| Type | Description |
|---|---|
TypeError |
3 arguments required |
// For the valid date: const result = isExists(2018, 0, 31) //=> true
// For the invalid date: const result = isExists(2018, 1, 31) //=> false
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isExists