Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/RoyalIcing/soonerorlater

JavaScript parser of natural language time periods
https://github.com/RoyalIcing/soonerorlater

date-parser javascript natural-language time-parsing typescript

Last synced: about 2 months ago
JSON representation

JavaScript parser of natural language time periods

Awesome Lists containing this project

README

        


💬 📅 Sooner or Later


Parse natural language dates



minified and gzipped size
minified size
zero dependencies

## Install

```console
npm add soonerorlater
```

-
-
-

## Examples

```javascript
import { parse } from "soonerorlater";

parse('Every Wednesday');
/*
{
repeats: 'weekly',
weekdays: new Set(['wednesday'])
}
*/

parse('Mondays and Thursdays at 9:30am to 10:30am');
/*
{
repeats: 'weekly',
weekdays: new Set(['monday', 'thursday']),
startTime: { hours: 9, minutes: 30 },
endTime: { hours: 10, minutes: 30 }
}
*/
```

## Notes

- Uses the library [parcook](https://github.com/RoyalIcing/parcook) for parsing.
- TODO: support standard representations as result