unit tests for calendar
refactoring