# openstreetmap-date-parser

> A parser for date values as they are used for start_date and similar tags.

Latest version **0.1.2** (published 2020-06-14) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-06-14 |
| First published | 2017-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Stephan Bösch-Plepelits |
| Maintainers | plepe |

## Links

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

## Recent versions

- 0.1.2 (latest) — 2020-06-14
- 0.1.1 — 2019-01-10
- 0.1.0 — 2017-12-15

## README

# openstreetmap-date-parser
A parser for date values as they are used for start_date and similar tags.

## Installations
```sh
npm install --save openstreetmap-date-parser
```

## Related modules
* [openstreetmap-date-format](https://github.com/plepe/openstreetmap-date-format): format a date string into a human readable string (several languages available)
* [openstreetmap-date-query](https://github.com/plepe/openstreetmap-date-query): builds a regexp from a date query, e.g. for usage with Overpass API.

## API
It will return an array with the lower and upper boundaries for the year in
which the event took place.

```js
var osmDateParser = require('openstreetmap-date-parser')

console.log(osmDateParser('1984-10-20'))
// [ 1984, 1984 ]

console.log(osmDateParser('1914..1918'))
// [ 1914, 1918 ]

console.log(osmDateParser('early 1920s'))
// [ 1920, 1923 ]

console.log(osmDateParser('before 1855'))
// [ null, 1854 ]
```

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