getStepCountBetween method

  1. @override
int getStepCountBetween(
  1. DateTimeExtents timeExtent,
  2. int tickIncrement
)

Returns the number steps/ticks are between the given extents inclusive.

Does not extend the extents to the bounding ticks.

Implementation

@override
int getStepCountBetween(DateTimeExtents timeExtent, int tickIncrement) {
  checkTickIncrement(tickIncrement);
  final min = timeExtent.start;
  final max = timeExtent.end;
  var time = getStepTimeAfterInclusive(min, tickIncrement);

  var cnt = 0;
  while (time.compareTo(max) <= 0) {
    cnt++;
    time = getNextStepTime(time, tickIncrement);
  }
  return cnt;
}