Add jasmine test suite and fix bug in controller for calendar