# date-minus

> Date minus by pure javascript

Latest version **1.0.1** (published 2017-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install date-minus
pnpm add date-minus
yarn add date-minus
bun add date-minus
```

## 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-09-22 |
| First published | 2017-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | x-cold |
| Maintainers | x-cold |
| Keywords | date |

## Links

- npm: https://www.npmjs.com/package/date-minus
- Repository: https://github.com/x-cold/date-minus
- Homepage: https://github.com/x-cold/date-minus#readme
- Issues: https://github.com/x-cold/date-minus/issues
- npm.io page: https://npm.io/package/date-minus

## 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-09-22
- 1.0.0 — 2017-09-22

## README

# date-minus
Date minus by pure javascript.

## Usage

### call the function

```js
const dateMinus = require('./').dateMinus;
var preDate = (new Date()).setFullYear(2009);
var howlong = dateMinus(preDate);
```

### output

```js
{
  "years": 8,
  "months": 0,
  "days": 0,
  "hours": "00",
  "minutes": "00",
  "seconds": "00",
  "passed": true, // date相对current为过去时间(date is earlier than current.)
  "date": "2009-09-22T15:52:28.861Z",
  "current": "2017-09-22T15:52:28.862Z"
}
```

## Parmeters

### input

参数名	| 类型 |	默认值 |	备注
-|-|-|-
date | Date/Number |	当前时间 |	减数
current |	Date/Number |	当前时间 | 被减数

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