# split-interval

> Splits a given interval across start and end times

Latest version **1.0.7** (published 2019-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install split-interval
pnpm add split-interval
yarn add split-interval
bun add split-interval
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-07-13 |
| First published | 2019-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | John Merchant |
| Maintainers | jmercha |
| Keywords | date, time, split, interval |

## Links

- npm: https://www.npmjs.com/package/split-interval
- Repository: https://github.com/jmercha/split-interval
- npm.io page: https://npm.io/package/split-interval

## Dependencies (2)

- [moment](https://npm.io/package/moment.md) ^2.24.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.5.4

## 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.7 (latest) — 2019-07-13
- 1.0.6 — 2019-07-13
- 1.0.5 — 2019-07-13
- 1.0.4 — 2019-07-13
- 1.0.2 — 2019-07-13
- 1.0.1 — 2019-07-13
- 1.0.0 — 2019-07-13

## README

# split-interval [![CircleCI](https://circleci.com/gh/jmercha/split-interval/tree/master.svg?style=svg)](https://circleci.com/gh/jmercha/split-interval/tree/master)

Splits the given interval across multiple days with start and end times.

## Usage

```
const splitInterval = require('split-interval');
splitInterval(startDate, endDate, startTime, endTime);
```

## Arguments

* `startDate` - A `Date` object representing the start of the interval to split
* `endDate` - A `Date` object representing the end of the interval to split
* `startTime` - A `String` in the format `hh:mm:ss` representing the start time of the interval segments
* `endTime` - A `String` in the format `hh:mm:ss` representing the end of the interval segments


## Example

Given the following interval `2019-06-01 12:00 PM` to `2019-06-04 12:00 PM`, with segments `8:30 AM` to `5:00 PM`, we will get the following segments as the result:

* `2019-06-01 12:00PM` - `2019-06-01 5:00PM`
* `2019-06-02 8:30AM` - `2019-06-02 5:00PM`
* `2019-06-03 8:30AM` - `2019-06-03 5:00PM`
* `2019-06-04 8:30AM` - `2019-06-04 12:00PM`

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