fixes setEvents method

calling setEvents method threw ReferenceError: calendar is not defined
fixes event object in template always being undefined
Merge pull request #7 from foaly-nr1/master

Fixes setEvents method and event objects in template