From 6d52ef25c911dcb8d37ead86819b53a7fe35ef53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 24 Jul 2023 14:09:50 +0200 Subject: [PATCH] fix: remove monthly recurring charging profiles 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 | 11 ----------- src/types/ocpp/1.6/ChargingProfile.ts | 1 - 2 files changed, 12 deletions(-) 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', } -- 2.34.1