getMaxMinute function

double getMaxMinute(
  1. double? maxMinute,
  2. MinuteInterval? interval
)

Get the maximum minute from interval

Implementation

double getMaxMinute(double? maxMinute, MinuteInterval? interval) {
  if (maxMinute == 59) {
    return 59;
  }
  int step = getIntFromMinuteIntervalEnum(interval);

  double max = 60;
  double i = 1;
  while (max > maxMinute!) {
    double val = 60 - (i * step);
    if (val <= maxMinute) {
      max = val;
    }
    i++;
  }
  return max;
}