depositAmountOn function

int? depositAmountOn(
  1. DepositType type,
  2. String day
)

Pfandbetrag in Cent am Wiener Tag day (YYYY-MM-DD): letzter Eintrag mit from <= day, sonst null.

Implementation

int? depositAmountOn(DepositType type, String day) {
  int? cents;
  for (final e in type.amounts) {
    if (e.from.compareTo(day) <= 0) {
      cents = e.cents;
    } else {
      break;
    }
  }
  return cents;
}