isBetween method

bool isBetween (
  1. DateTime lower,
  2. DateTime upper
)

Returns true if this DateTime value is not older than lower (or lower=null) and not younger than upper (or upper=null).

Implementation

bool isBetween(DateTime lower, DateTime upper) {
  if ((lower != null) && (isBefore(lower))) return false;
  if ((upper != null) && (isAfter(upper))) return false;
  return true;
}