Is the given date in the leap year?
Is the given date in the leap year?
// CommonJS
var isLeapYear = require('date-fns/isLeapYear')
// ES 2015 import isLeapYear from 'date-fns/isLeapYear'
// ESM
import { isLeapYear } from 'date-fns'
isLeapYear(date)
| Name | Description |
|---|---|
date |
the date to check |
| Description |
|---|
|
the date is in the leap year |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// Is 1 September 2012 in the leap year? const result = isLeapYear(new Date(2012, 8, 1)) //=> true
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/isLeapYear