Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nothingrandom/ydmo
- Owner: nothingrandom
- License: mit
- Created: 2020-01-21T11:10:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T17:07:07.000Z (over 1 year ago)
- Last Synced: 2024-05-02T01:55:47.653Z (9 months ago)
- Topics: date, date-time, fuzzy, nodejs, parser, time, utility
- Language: JavaScript
- Homepage:
- Size: 837 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)