I made something similar like this a while ago, it may be half baked but its fully open source & has some unit tests - https://github.com/bookingbat/engine
I made something similar like this a while ago, it may be half baked but its fully open source & has some unit tests - https://github.com/bookingbat/engine
From FAQ:
IS IT FREE & OPEN SOURCE?
Yes & yes! Booking.js actually consists of two components: FullCalendar and the Timekit API. The actual implementation is open source on Github and we'd love PRs. It's worth noting that the actual use of the widget is meant to be included with JS served from our CDN so we can push out updates and track usage.
Seems disingenuous to say "not really" to the open source question when it has such a liberal license. Fork it to use whatever you want.
Did anybody implemented a server API compatible with Calendar?
The widget itself is based on open source components and is on Github (https://github.com/timekit-io/booking-js), but the trigger is that's it's using our core API. The API is 100% free to use though (http://timekit.io/pricing)