Basic logic of a calendar view