Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nothingrandom/ydmo

Date parsing for a past or future data with a simple short letter format
https://github.com/nothingrandom/ydmo

date date-time fuzzy nodejs parser time utility

Last synced: about 1 month ago
JSON representation

Date parsing for a past or future data with a simple short letter format

Awesome Lists containing this project

README

        

# ydmo
![Travis (.com)](https://img.shields.io/travis/com/nothingrandom/ydmo)
> Date parsing for a past or future data with a simple short letter format

## Install

``` bash
$ yarn add ydmo
$ npm install ydmo
```

## Usage (ES6 imports)
``` js
import ydmo from 'ydmo';

// returns date 1 year and 3 days in the future
const futureDate = ydmo('+1y3d');

// returns date 1 year and 3 days in the past
const pastData = ydmo('-6mo4h');
```

## Date codes
Year: `y`

Month: `mo` or `m`

Week: `w`

Day: `d`

Hour: `h`

Minute: `mi`

Second: `s`

## License
MIT © [Benjamin Grant](https://nothingrandom.com)