An open API service indexing awesome lists of open source software.

https://github.com/datetime/leap-year

Check if a year is a leap year
https://github.com/datetime/leap-year

Last synced: over 1 year ago
JSON representation

Check if a year is a leap year

Awesome Lists containing this project

README

          

# leap-year [![Build Status](https://travis-ci.org/datetime/leap-year.svg?branch=master)](https://travis-ci.org/datetime/leap-year)

> Check if a year is a [leap year](http://en.wikipedia.org/wiki/Leap_year)

## Install

```
$ npm install --save leap-year
```

## Usage

```js
var leapYear = require('leap-year');

leapYear(2014);
//=> false

leapYear(2016);
//=> true
```

## API

### leapYear([year])

#### year

Type: `number`
Default: current year

### leapYear([date])

#### date

Type: `date`
Default: `new Date()`

## License

MIT © [Sindre Sorhus](http://sindresorhus.com)