# conversational-date-parser

> Context aware parsing of date like strings

Latest version **1.1.1** (published 2021-03-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install conversational-date-parser
pnpm add conversational-date-parser
yarn add conversational-date-parser
bun add conversational-date-parser
```

## 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.1.1 |
| Published | 2021-03-25 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | c0d3runn3r |

## Links

- npm: https://www.npmjs.com/package/conversational-date-parser
- Repository: https://github.com/c0d3runn3r/cdp
- Homepage: https://github.com/c0d3runn3r/cdp#readme
- Issues: https://github.com/c0d3runn3r/cdp/issues
- npm.io page: https://npm.io/package/conversational-date-parser

## Dependencies (1)

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

## Recent versions

- 1.1.1 (latest) — 2021-03-25
- 1.1.0 — 2021-03-22
- 1.0.3 — 2021-02-01
- 1.0.2 — 2021-02-01
- 1.0.1 — 2021-02-01
- 1.0.0 — 2021-02-01

## README

# CDP
Conversational date parser

Performs context aware parsing of strings like 'year to date' or 'Q3 2020' or 'march-april'.

### Installation
```bash
npm install --save conversational-date-parser
npm run test
```

### Usage
```js
const Cdp=require("conversational-date-parser");

let cdp=new CDP();
let result=cdp.parse("March through April 2015"); // [{"year":2015,"month":3,"day":1},{"year":2015,"month":4, "day":30}]

````

### Notes
CDP.parse() returns an array that is either empty, or contains two elements representing the range inferred by the text input.  Input like "today" will result in a one-day date range; calling .toDate() on each result item will result in a Date() object that represents the first millisecond and the last millisecond of that day, respectively.


### Todo
- Remove dependency on moment.js
- Finish documenting index.js
- Add build task for compiling documentation
- Clean up one of the tests that is not a unit test
- Add more cases ("thursday through friday", etc)

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