optimized getMultipleRunDates

max(0, $total) doesn't need to be calculated in every iteration.