X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16ServiceUtils.ts;h=bd96c4b3fab81d8c4fc10e79b979774a9309d9fd;hb=48c7e1d6db4b3cbf82d17e191b2255066c462a71;hp=1f119a2e4753fb476bb6ee1ddf8e13e5e96cfd8c;hpb=a974c8e4b8a98c9450be49546a77be0d03e9f512;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 1f119a2e..bd96c4b3 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -38,7 +38,7 @@ import { type OCPP16SupportedFeatureProfiles, OCPPVersion } from '../../../types/index.js' -import { isNotEmptyArray, logger, roundTo } from '../../../utils/index.js' +import { convertToDate, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js' import { OCPPServiceUtils } from '../OCPPServiceUtils.js' export class OCPP16ServiceUtils extends OCPPServiceUtils { @@ -164,6 +164,12 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion chargingStation.getConnectorStatus(connectorId)!.chargingProfiles = [] } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + cp.chargingSchedule.startSchedule = convertToDate(cp.chargingSchedule.startSchedule)! + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + cp.validFrom = convertToDate(cp.validFrom)! + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + cp.validTo = convertToDate(cp.validTo)! let cpReplaced = false if (isNotEmptyArray(chargingStation.getConnectorStatus(connectorId)?.chargingProfiles)) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion