adds view events by date function