0.1.2 • Published 4 years ago

openstreetmap-date-parser v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

openstreetmap-date-parser

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

Installations

npm install --save openstreetmap-date-parser

Related modules

API

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

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 ]