# within-one-year

> A module to judge whether it is within one year

Latest version **1.0.1** (published 2017-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install within-one-year
pnpm add within-one-year
yarn add within-one-year
bun add within-one-year
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-01-11 |
| First published | 2017-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | kjirou |
| Maintainers | kjirou |
| Keywords | date, term, year, check |

## Links

- npm: https://www.npmjs.com/package/within-one-year
- Repository: https://github.com/kjirou/within-one-year
- Homepage: https://github.com/kjirou/within-one-year#readme
- Issues: https://github.com/kjirou/within-one-year/issues
- npm.io page: https://npm.io/package/within-one-year

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-01-11
- 1.0.0 — 2017-01-11

## README

# within-one-year

[![npm version](https://badge.fury.io/js/within-one-year.svg)](https://badge.fury.io/js/within-one-year)

A module to judge whether it is within one year


## Installation

```bash
npm install within-one-year
```


## Usage

```js
const withinOneYear = require('within-one-year');

const from = new Date('2017-01-01T00:00:00.000Z');
console.log(withinOneYear(from, new Date('2018-01-01T00:00:00.000Z')));  // -> true
console.log(withinOneYear(from, new Date('2018-01-01T00:00:00.001Z')));  // -> false
```


## Interpretation of leap years
- `2016-02-29 + 1 year` => `2017-03-01`
- `2015-03-01 + 1 year` => `2016-03-01`
- `2015-02-28 + 1 year` => `2016-02-28`

---
_Source: https://npm.io/package/within-one-year · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
