From ebc5975b9a9b2a7cb54d0c9ce32b1a9f303d24d6 Mon Sep 17 00:00:00 2001 From: simvalery Date: Mon, 9 Dec 2024 17:08:02 +0400 Subject: [PATCH] fix Signed-off-by: simvalery --- .../controls/date-time/date-time.component.ts | 5 ++--- .../schema-form/schema-form.component.html | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/modules/schema-engine/schema-form/controls/date-time/date-time.component.ts b/frontend/src/app/modules/schema-engine/schema-form/controls/date-time/date-time.component.ts index 79991a74e4..8577070eb9 100644 --- a/frontend/src/app/modules/schema-engine/schema-form/controls/date-time/date-time.component.ts +++ b/frontend/src/app/modules/schema-engine/schema-form/controls/date-time/date-time.component.ts @@ -58,9 +58,7 @@ export class DateTimeComponent implements OnInit, AfterViewInit, OnChanges, OnDe fillField() { const comment = this.item?.field?.comment && JSON.parse(this.item.field.comment); let value: any = null; - if (this.value) { - value = this.value; - } else if (this.timeOnly && this.type && comment && comment[this.type]) { + if (this.timeOnly && this.type && comment && comment[this.type]) { value = comment.suggest; } else if (this.calendar?.value) { value = this.calendar?.value; @@ -77,6 +75,7 @@ export class DateTimeComponent implements OnInit, AfterViewInit, OnChanges, OnDe this.control.setValue(date); input.value = moment(value, 'hh-mm-ss').format('HH:mm:ss'); } else { + this.control.setValue(moment(value).toDate()) input.value = moment(value).format('YYYY-MM-DD HH:mm:ss'); } } diff --git a/frontend/src/app/modules/schema-engine/schema-form/schema-form.component.html b/frontend/src/app/modules/schema-engine/schema-form/schema-form.component.html index 09db9d27e0..a28c7bbb94 100644 --- a/frontend/src/app/modules/schema-engine/schema-form/schema-form.component.html +++ b/frontend/src/app/modules/schema-engine/schema-form/schema-form.component.html @@ -61,17 +61,18 @@
-
-
@@ -195,18 +196,19 @@