Fixed ensure date format in Storage
MODIFY
src/storage/mongodb/DatabaseUtils.ts
src/storage/mongodb/DatabaseUtils.ts
@@ -347,11 +347,11 @@ export default class DatabaseUtils {
dest.lastChangedBy = null;
if (entity.createdBy || entity.createdOn) {
dest.createdBy = DatabaseUtils._mongoConvertUserID(entity, 'createdBy');
- dest.createdOn = entity.createdOn;
+ dest.createdOn = Utils.convertToDate(entity.createdOn);
}
if (entity.lastChangedBy || entity.lastChangedOn) {
dest.lastChangedBy = DatabaseUtils._mongoConvertUserID(entity, 'lastChangedBy');
- dest.lastChangedOn = entity.lastChangedOn;
+ dest.lastChangedOn = Utils.convertToDate(entity.lastChangedOn);
}
}

MODIFY
src/storage/mongodb/OCPIEndpointStorage.ts
src/storage/mongodb/OCPIEndpointStorage.ts
@@ -63,7 +63,7 @@ export default class OCPIEndpointStorage {
businessDetails: ocpiEndpointToSave.businessDetails,
availableEndpoints: ocpiEndpointToSave.availableEndpoints,
versionUrl: ocpiEndpointToSave.versionUrl,
- lastPatchJobOn: ocpiEndpointToSave.lastPatchJobOn,
+ lastPatchJobOn: Utils.convertToDate(ocpiEndpointToSave.lastPatchJobOn),
lastPatchJobResult: ocpiEndpointToSave.lastPatchJobResult
};
// Add Last Changed/Created props

MODIFY
src/storage/mongodb/OICPEndpointStorage.ts
src/storage/mongodb/OICPEndpointStorage.ts
@@ -41,7 +41,6 @@ export default class OICPEndpointStorage {
} else {
oicpEndpointFilter._id = new ObjectID();
}
-
const oicpEndpointMDB: any = {
_id: oicpEndpointFilter._id,
name: oicpEndpointToSave.name,
@@ -53,7 +52,7 @@ export default class OICPEndpointStorage {
status: oicpEndpointToSave.status,
businessDetails: oicpEndpointToSave.businessDetails,
availableEndpoints: oicpEndpointToSave.availableEndpoints,
- lastPatchJobOn: oicpEndpointToSave.lastPatchJobOn,
+ lastPatchJobOn: Utils.convertToDate(oicpEndpointToSave.lastPatchJobOn),
lastPatchJobResult: oicpEndpointToSave.lastPatchJobResult,
version: oicpEndpointToSave.version
};

Fixed ensure date format in Storage