isWithinRange method

bool isWithinRange(
  1. DateTime start,
  2. DateTime end
)

Checks if the current date falls within a range of start and end

Implementation

bool isWithinRange(DateTime start, DateTime end) =>
    isAfter(start) && isBefore(end) || isSameDate(start) || isSameDate(end);