# is-date-calculator

> Calculator for dates. Add , Subtract and find difference between two dates.

Latest version **1.0.2** (published 2022-08-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-date-calculator
pnpm add is-date-calculator
yarn add is-date-calculator
bun add is-date-calculator
```

## 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.2 |
| Published | 2022-08-08 |
| First published | 2022-08-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Krishanu Mishra |
| Maintainers | krishanu_23 |
| Keywords | date-calc |

## Links

- npm: https://www.npmjs.com/package/is-date-calculator
- Repository: https://github.com/KrishanuMishra/date-calculator-npm-package
- Homepage: https://github.com/KrishanuMishra/date-calculator-npm-package#readme
- Issues: https://github.com/KrishanuMishra/date-calculator-npm-package/issues
- npm.io page: https://npm.io/package/is-date-calculator

## Recent versions

- 1.0.2 (latest) — 2022-08-08
- 1.0.1 — 2022-08-08
- 1.0.0 — 2022-08-08

## README

��# Date Calculator npm Package
 
 # Prerequisite
 This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
 
 ```
 $ npm -v && node -v
6.4.1
v8.16.0
 ```

# Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

## Installation

To install and set up the library, run:
```
$ npm i is-date-calculator
```

Or if you prefer using Yarn:

```
$ yarn add is-date-calculator
```

# Usage

##

## To add days to a date:

```
const d = require("is-date-calculator");

const b = new d();
const date = new Date();// 8/8/2022
const c = b.addDays(date,10);

console.log(c.toLocaleDateString());
```
### Output
```
18/8/2022
```
## To subtract days from a date:

```
const d = require("is-date-calculator");

const b = new d();
const date = new Date();// 8/8/2022
const c = b.subDays(date,10);

console.log(c.toLocaleDateString());
```
### Output
```
29/7/2022
```

## To find difference between two dates:
```
const d = require("is-date-calculator");

const b = new d();
const date1 = new Date('1/1/1');
const date2 = new Date('2/2/2');
const day = b.diffDays(date1,date2);
const month = b.diffMonth(date1,date2);
const year = b.diffYear(date1,date2);


console.log(day);
console.log(month);
console.log(year);
```

### Output
```
397
14
1
```

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