From 05b52716e8aecade28e957d243969639086fd1e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 25 Jul 2023 20:39:47 +0200 Subject: [PATCH] fix: fix recurring charging profile translation to current time interval MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index cd586a1c..ca4ec0b2 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -829,7 +829,7 @@ const prepareRecurringChargingProfile = ( ) { chargingSchedule.startSchedule = addDays( chargingSchedule.startSchedule!, - differenceInDays(recurringInterval.end, chargingSchedule.startSchedule!), + differenceInDays(currentDate, recurringInterval.start), ); recurringInterval = { start: chargingSchedule.startSchedule, @@ -849,7 +849,7 @@ const prepareRecurringChargingProfile = ( ) { chargingSchedule.startSchedule = addWeeks( chargingSchedule.startSchedule!, - differenceInWeeks(recurringInterval.end, chargingSchedule.startSchedule!), + differenceInWeeks(currentDate, recurringInterval.start), ); recurringInterval = { start: chargingSchedule.startSchedule, -- 2.34.1