Commit 3fb6d7fa authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18721 TIME 0:30 indexing model changed : set saved value when field value if empty

parent 31fee61d
......@@ -770,7 +770,6 @@ export class IndexingFormComponent implements OnInit {
}));
if (this.resId !== null) {
await this.setResource(saveResourceState);
}
......@@ -813,11 +812,14 @@ export class IndexingFormComponent implements OnInit {
await this.getCurrentInitiator(elem, fieldValue);
}
if (elem.type === 'date' && !this.functions.empty(fieldValue)) {
fieldValue = new Date(fieldValue);
} else{
elem.default_value = null;
this.arrFormControl[elem.identifier].value = null;
if (elem.type === 'date') {
if (!this.functions.empty(fieldValue) || elem.default_value !== null) {
fieldValue = elem.default_value !== null ? elem.default_value : fieldValue;
fieldValue = new Date(fieldValue);
} else {
elem.default_value = null;
this.arrFormControl[elem.identifier].value = null;
}
}
if (!this.functions.empty(fieldValue)) {
this.arrFormControl[elem.identifier].setValue(fieldValue);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment