add conditions for calendar