refactoring calendar into a directive
refactoring