isBetween method

bool isBetween(
  1. DateTime start,
  2. DateTime end, {
  3. bool inclusive = true,
})

Implementation

bool isBetween(
  DateTime start,
  DateTime end, {
  bool inclusive = true,
}) {
  if (inclusive) {
    return !isBefore(start) && !isAfter(end);
  }

  return isAfter(start) && isBefore(end);
}