# moment-rental

> Fork of moment-business to support Saturdays and rental day breakdown

Latest version **1.0.0** (published 2016-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install moment-rental
pnpm add moment-rental
yarn add moment-rental
bun add moment-rental
```

## 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.0 |
| Published | 2016-09-19 |
| First published | 2015-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | thisiskeith |

## Links

- npm: https://www.npmjs.com/package/moment-rental
- Repository: https://github.com/thisiskeith/moment-rental
- Issues: https://github.com/thisiskeith/moment-rental/issues
- npm.io page: https://npm.io/package/moment-rental

## Dependencies (1)

- [moment](https://npm.io/package/moment.md) ^2.9.0

## Recent versions

- 1.0.0 (latest) — 2016-09-19
- 0.3.1 — 2016-03-17
- 0.3.0 — 2016-03-16
- 0.2.1 — 2015-10-26

## README

# moment-rental

#### Summary
Extends Moment.js to properly calculate the number of rental days between two given dates


#### Syntax: Add rental days to current date
```js
moment().rentalAdd(days[, saturdays]);
```
#### Parameters
- `days (integer)` Number of rental days to add to current date
- `saturdays (BOOL)` Weather or not to include Saturdays


#### Syntax: Get rental day breakdown
```js
moment(endDate).rentalDays(startDate[, saturdays]);
```
#### Parameters
- `endDate (moment object)` End date of rental
- `startDate (moment object)` Start date of rental
- `saturdays (BOOL)` Weather or not to include Saturdays


## Installation

#### Install package
```js
npm i moment-rental -S
```
#### Require in project
```js
// ES5
var moment = require('moment');
require('moment-rental');

// ES6
import moment from 'moment';
import moment-rental;
```

## Examples

#### Get new end date
```js
moment('2015-02-04').rentalAdd(3).format('MM-DD-YYYY');
// 02-09-2015
```
#### Get new end date including Saturdays
```js
moment('2015-02-04').rentalAdd(3, true).format('MM-DD-YYYY');
// 02-07-2015
```
#### Get rental day breakdown
```js
moment('2015-02-12 08:00').rentalDays('2015-02-04 08:00');
// { Day: 0, FourWeek: 0, RentalDays: 6, Week: 1 }
```
#### Get rental day breakdown including Saturdays
```js
moment('2015-02-12 08:00').rentalDays('2015-02-04 08:00', true);
// { Day: 0, FourWeek: 0, RentalDays: 7, Week: 1 }
```

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