ambit
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "ambit", | ||
"description": "Date parser that returns a range instead of a single value", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Michael Garvin <gar@comrade.us>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -1,9 +0,26 @@ | ||
#date-range-parser | ||
#ambit | ||
So it turns out I couldn't find anything out there that parsed a date | ||
string in nominally plain English and returned a date range. This is a | ||
WIP attempt at doing so. Requires moment, will hopefully eventually be | ||
rewritten to work better with moment, and get a proper package.json and | ||
all that jazz. (Also it needs a better name) | ||
WIP attempt at doing so. Requires moment. | ||
#use | ||
```javascript | ||
var ambit = require('ambit'); //ambit is moment + ambit now; | ||
var range = ambit.ambit('Spring 2005'); | ||
``` | ||
range will now either be undefined (unparseable input) or an object w/ a ``start`` and ``end`` attribute, which will be moment objects representing the start and end range of the input. | ||
##formatting | ||
```javascript | ||
var ambit = require('ambit'); | ||
var range = ambit.ambit('Sept 2020', 'YYYY-MM-DD'); | ||
``` | ||
the ``start`` and ``end`` attributes will now be strings formatted ``YYYY-MM-DD`` | ||
That's about it for now, it's pretty basic, probably has lots of edge-case bugs, and needs more tests. | ||
License: MIT |
10923
27