Added parameter calendar to hasEventAtDate function to avoid calling [NSCalendar currentCalendar] every time the function is called since it's a very expensive routine (it returns each time a copy of the current calendar).