static bool containsDate(List<DateTime> dates, DateTime targetDate) { for (DateTime date in dates) { if (isSameDay(date, targetDate)) { return true; } } return false; }