Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hackergrrl/parse-messy-schedule
parse recurring or one-off scheduled events from free-form text
https://github.com/hackergrrl/parse-messy-schedule
Last synced: 20 days ago
JSON representation
parse recurring or one-off scheduled events from free-form text
- Host: GitHub
- URL: https://github.com/hackergrrl/parse-messy-schedule
- Owner: hackergrrl
- License: bsd-2-clause
- Created: 2015-12-11T00:26:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-11T05:03:17.000Z (almost 9 years ago)
- Last Synced: 2024-10-10T16:09:14.473Z (about 1 month ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# parse-messy-schedule
parse recurring or one-off scheduled events from free-form text
# example
``` js
var parse = require('parse-messy-schedule')
var str = process.argv.slice(2).join(' ')
var ev = parse(str)console.log('#', ev.title)
var n = undefined
for (var i = 0; i < 3; i++) {
n = ev.next(n)
if (!n) break
console.log(n)
}
```output:
```
$ node next3.js DMV tomorrow at 10:30
# DMV
Fri Dec 11 2015 10:30:00 GMT-0800 (PST)
``````
$ node next3.js javascript study group thursdays at 7 pm
# javascript study group
Thu Dec 10 2015 19:00:00 GMT-0800 (PST)
Thu Dec 17 2015 19:00:00 GMT-0800 (PST)
Thu Dec 24 2015 19:00:00 GMT-0800 (PST)
``````
$ node next3.js oakland wiki 18:30 every other wednesday starting dec 2 until dec 23
# oakland wiki
Wed Dec 16 2015 18:30:00 GMT-0800 (PST)
Wed Dec 23 2015 18:30:00 GMT-0800 (PST)
```# api
``` js
var parse = require('parse-messy-schedule')
```## var m = parse(str, opts)
Parse `str`, returning a parse object `m`.
* `opts.created` - the time when `str` was created
## m.title
event title
## m.next(base)
Return the next time the event will be held starting from `base`, or now if
`base` isn't given.# install
```
npm install parse-messy-schedule
```# license
BSD