modified code for calendar template to display events