refactor: cleanup variable namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 24 Jul 2023 14:38:53 +0000 (16:38 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 24 Jul 2023 14:38:53 +0000 (16:38 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index b44bf75d0d735c16eb1db19ce550548c8341925b..0f2f5217956100920f6c1377e21ad5b6105017dd 100644 (file)
@@ -1031,11 +1031,14 @@ export class ChargingStation {
     );
     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,
@@ -1045,7 +1048,10 @@ export class ChargingStation {
           }
         } 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,