);
if (interval > 0) {
this.reservationExpirationSetInterval = setInterval((): void => {
- const dateNow = new Date();
+ const currentDate = new Date();
if (this.hasEvses) {
for (const evseStatus of this.evses.values()) {
for (const connectorStatus of evseStatus.connectors.values()) {
- if (connectorStatus.reservation && connectorStatus.reservation.expiryDate < dateNow) {
+ if (
+ connectorStatus.reservation &&
+ connectorStatus.reservation.expiryDate < currentDate
+ ) {
this.removeReservation(
connectorStatus.reservation,
ReservationTerminationReason.EXPIRED,
}
} else {
for (const connectorStatus of this.connectors.values()) {
- if (connectorStatus.reservation && connectorStatus.reservation.expiryDate < dateNow) {
+ if (
+ connectorStatus.reservation &&
+ connectorStatus.reservation.expiryDate < currentDate
+ ) {
this.removeReservation(
connectorStatus.reservation,
ReservationTerminationReason.EXPIRED,