X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=3051abb7065de6382b2ffd7f2ba6d88c9bb23685;hb=98c19a0738935a04ceedd45ccd198769ef91f035;hp=02c7a0e069c1c23bcd197288c91492ca28234b0c;hpb=bece9cdc396c31242b2be77e834805e4a8b084d5;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 02c7a0e0..3051abb7 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -743,12 +743,13 @@ export default class ChargingStation { timestamp >= chargingProfile.chargingSchedule.startSchedule.getTime() + chargingSchedulePeriod.startPeriod * 1000 && - chargingProfile.chargingSchedule.chargingSchedulePeriod[index + 1] && - timestamp < - chargingProfile.chargingSchedule.startSchedule.getTime() + - chargingProfile.chargingSchedule.chargingSchedulePeriod[index + 1] - ?.startPeriod * - 1000; + ((chargingProfile.chargingSchedule.chargingSchedulePeriod[index + 1] && + timestamp < + chargingProfile.chargingSchedule.startSchedule.getTime() + + chargingProfile.chargingSchedule.chargingSchedulePeriod[index + 1] + ?.startPeriod * + 1000) || + !chargingProfile.chargingSchedule.chargingSchedulePeriod[index + 1]); } ); if (!Utils.isEmptyArray(chargingSchedulePeriods)) {