Skip to content

Commit

Permalink
fix suggesion datetime
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Nov 27, 2024
1 parent 0cc3bba commit b644cab
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,20 @@ export class SchemaFormComponent implements OnInit {

parseDate(item: string | string[], calendar: any, index?: number) {
setTimeout(() => {
if (calendar.dateParsed) {
return;
}
if (Array.isArray(item) && (index !== undefined) && item[index]) {
console.log(item, index);
if (!calendar.el.nativeElement.querySelector('input').value && item[index]) {
if (!calendar.el.nativeElement.querySelector('input').value) {
calendar.el.nativeElement.querySelector('input').value = moment(item[index]).format('YYYY-MM-DD HH:mm:ss');
}
} else if (item) {
if (!calendar.el.nativeElement.querySelector('input').value && item) {
if (!calendar.el.nativeElement.querySelector('input').value) {
calendar.el.nativeElement.querySelector('input').value = moment(item).format('YYYY-MM-DD HH:mm:ss');
}
}
}, 200);
calendar.dateParsed = true;
}, 50);

}

Expand Down

0 comments on commit b644cab

Please sign in to comment.