refactor and document the calendars helper
Merge pull request #1250 from opf/fix/calendar_helper_refactoring

Refactor and document the calendars helper