https://github.com/raineorshine/freebusy
Determine free blocks from a list of events and free/busy rules.
https://github.com/raineorshine/freebusy
Last synced: 2 months ago
JSON representation
Determine free blocks from a list of events and free/busy rules.
- Host: GitHub
- URL: https://github.com/raineorshine/freebusy
- Owner: raineorshine
- License: isc
- Created: 2015-08-03T01:54:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-17T03:32:15.000Z (almost 10 years ago)
- Last Synced: 2025-04-11T03:52:02.500Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# freebusy
[](https://npmjs.org/package/freebusy)
[](https://travis-ci.org/metaraine/freebusy)> Determine free blocks from a list of events and free/busy rules.
## Install
```sh
$ npm install --save freebusy
```## Usage
```js
var freebusy = require('freebusy')// find all remaining free time from June 1-3 outside of an event that occurs from 12-1pm on June 2.
freebusy({
start: new Date('2015-06-01 00:00'),
end: new Date('2015-06-04 00:00'),
events: [{
start: new Date('2015-06-02 12:00'),
end: new Date('2015-06-02 13:00')
}]
})// returns:
[
// June 1 is free
{ start: Mon Jun 01 2015 00:00:00 GMT-0600 (MDT),
end: Tue Jun 02 2015 00:00:00 GMT-0600 (MDT) },
// June 2 is free from 00:00 - 12:00 and 13:00 - 24:00
{ start: Tue Jun 02 2015 00:00:00 GMT-0600 (MDT),
end: Tue Jun 02 2015 12:00:00 GMT-0600 (MDT) },
{ start: Tue Jun 02 2015 13:00:00 GMT-0600 (MDT),
end: Wed Jun 03 2015 00:00:00 GMT-0600 (MDT) },
// June 3 is free
{ start: Wed Jun 03 2015 00:00:00 GMT-0600 (MDT),
end: Thu Jun 04 2015 00:00:00 GMT-0600 (MDT) }
]
```## Contributing
Powered by npm scripts.
## License
ISC © [Raine Lourie](https://github.com/metaraine)