occursOnDate method
Returns a boolean that defines whether current event is occurring on
currentDate or not.
Implementation
bool occursOnDate(DateTime currentDate) {
return currentDate == date ||
currentDate == endDate ||
(currentDate.isBefore(endDate.withoutTime) &&
currentDate.isAfter(date.withoutTime));
}