Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Dec 9, 2024
1 parent 10b8559 commit ebc5975
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,18 @@
</div>

<div *ngIf="isDateTime(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="item.control" [item]="item"
<date-time-control [control]="item.control" [item]="item" type="default"
[value]="item.suggest"></date-time-control>
</div>

<div *ngIf="isDate(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="item.control" [item]="item" [showSeconds]="false"
<date-time-control [control]="item.control" [item]="item" [showSeconds]="false" type="default"
[showTime]="false"></date-time-control>
</div>

<div *ngIf="isTime(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="item.control" [item]="item" [showSeconds]="true" [showTime]="true"
type="default"
[timeOnly]="true"></date-time-control>
</div>

Expand Down Expand Up @@ -195,18 +196,19 @@

<div *ngIf="isDateTime(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="listItem.control" [index]="i" [isMany]="true"
[item]="item"
[item]="item" type="suggest"
[value]="item.suggest"></date-time-control>
</div>

<div *ngIf="isDate(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="listItem.control" [isMany]="true" [item]="listItem"
type="suggest"
[showSeconds]="false" [showTime]="false"></date-time-control>
</div>

<div *ngIf="isTime(item)" class="form-field-input guardian-input-container">
<date-time-control [control]="listItem.control" [index]="i" [isMany]="true"
[item]="item"
[item]="item" type="suggest"
[showSeconds]="true" [showTime]="true"
[timeOnly]="true"></date-time-control>
</div>
Expand Down

0 comments on commit ebc5975

Please sign in to comment.