# date-sequence

> Given a from and to date, creates a sequence of date ranges for use in graphs.

Latest version **1.0.2** (published 2021-10-21) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-10-21 |
| First published | 2021-04-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | cantgetright82 |

## Links

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

## Dependencies (1)

- [dayjs](https://npm.io/package/dayjs.md) ^1.10.4

## Recent versions

- 1.0.2 (latest) — 2021-10-21
- 1.0.1 — 2021-04-24
- 1.0.0 — 2021-04-08

## README

# Given a from and to date, creates a sequence of date ranges for use in graphs.

## Install
```
yarn add date-sequence
```

## Usage
```
import DateSequence from 'date-sequence';

const sequence = DateSequence.create('2021-04-01', '2021-04-10');
```

Results in:

```
{
  unit: 'day',
  buckets: [
    { label: '2021-04-01', from: '2021-04-01', to: '2021-04-02' },
    { label: '2021-04-02', from: '2021-04-02', to: '2021-04-03' },
    { label: '2021-04-03', from: '2021-04-03', to: '2021-04-04' },
    { label: '2021-04-04', from: '2021-04-04', to: '2021-04-05' },
    { label: '2021-04-05', from: '2021-04-05', to: '2021-04-06' },
    { label: '2021-04-06', from: '2021-04-06', to: '2021-04-07' },
    { label: '2021-04-07', from: '2021-04-07', to: '2021-04-08' },
    { label: '2021-04-08', from: '2021-04-08', to: '2021-04-09' },
    { label: '2021-04-09', from: '2021-04-09', to: '2021-04-10' },
    { label: '2021-04-10', from: '2021-04-10', to: '2021-04-11' }
  ],
  from: '2021-04-01',
  to: '2021-04-10'
}
```

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