Library implementing a timeslot functionality
**This project is in active development. Breaking changes can and will occur
as long as this notice is here**
Say you need to allow a user to specify when they want notifications, you can
specify a string such as "0800:1600:12345" which will be true between 0800 and
1600 Monday through Friday.
The project supports and uses:
* Keep A Changelog
* Semantic Versioning
javascript
var timeslot = require('timeslotjs');
`Objectify timeslot string
`javascript
var timeslot = require('timeslotjs');
timeslot.objectify('0800:1530:04')
`Stringify timeslot object
`javascript
var timeslot = require('timeslotjs');
var timeslotObject = {
start: {hour: '08', minute: '00'},
end: {hour: '15', minute: '30'},
weekdays: [0,4]
}
timeslot.stringify(timeslotObject)
`
Match a timeslot to a timestamp
`javascript
var timeslot = require('timeslotjs');
var timeslotObject = {
start: {hour: '08', minute: '00'},
end: {hour: '1'5, minute: '30'},
weekdays: [0,4]
}
timeslotObject.excluded = [
'2017-06-17T08:01:00+02:00',
'2017-06-16T08:01:00+02:00'
]
match(timeslotObject, '2017-06-18T08:01:00+02:00')//true if it matches, false if not
``