From: Jérôme Benoit Date: Mon, 24 Jul 2023 12:09:50 +0000 (+0200) Subject: fix: remove monthly recurring charging profiles X-Git-Tag: v1.2.20~159^2~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6d52ef25c911dcb8d37ead86819b53a7fe35ef53;p=e-mobility-charging-stations-simulator.git fix: remove monthly recurring charging profiles Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index f6119f3d..090ca65d 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -6,19 +6,15 @@ import { fileURLToPath } from 'node:url'; import chalk from 'chalk'; import { addDays, - addMonths, addSeconds, addWeeks, - endOfMonth, endOfWeek, isAfter, isBefore, isTomorrow, isYesterday, - startOfMonth, startOfWeek, subDays, - subMonths, subWeeks, } from 'date-fns'; @@ -712,13 +708,6 @@ const getLimitFromChargingProfiles = ( subWeeks(chargingSchedule.startSchedule, 1); } break; - case RecurrencyKindType.MONTHLY: - if (isBefore(chargingSchedule.startSchedule, startOfMonth(currentDate))) { - addMonths(chargingSchedule.startSchedule, 1); - } else if (isAfter(chargingSchedule.startSchedule, endOfMonth(currentDate))) { - subMonths(chargingSchedule.startSchedule, 1); - } - break; } } // Check if the charging profile is active diff --git a/src/types/ocpp/1.6/ChargingProfile.ts b/src/types/ocpp/1.6/ChargingProfile.ts index b2909699..430f6c28 100644 --- a/src/types/ocpp/1.6/ChargingProfile.ts +++ b/src/types/ocpp/1.6/ChargingProfile.ts @@ -46,5 +46,4 @@ export enum OCPP16ChargingProfilePurposeType { export enum OCPP16RecurrencyKindType { DAILY = 'Daily', WEEKLY = 'Weekly', - MONTHLY = 'Monthly', }