Hi Team,
I am implementing DateTimePicker in queryBuilder, which lands me into two errors.
1.validation error even value field displays current date. after debugging i found that value field is behaving like 'null'.
2. If i try to change the date validation error tooltip still stays on the page and it never gets destroyed until we refresh the page.
Please help in solving the issue.
below is the code which I am using for the feature.
{ field: 'Date', label: 'Date', type: 'date',
template: {
create: () => {
const elem = document.createElement('input');
elem.setAttribute('type', 'Date');
return elem;
},
destroy: (args) => {
const datetime = getComponent(document.getElementById(args.elementId), 'datetimepicker');
if (datetime) {
datetime.destroy();
}
},
write: (args) => {
const dateTimeInstance = new DateTimePicker({
value: new Date();,
format: 'yyyy-MM-dd hh:mm',
change: (e) => {
console.log(e);
qryBldrObj.notifyChange(e.value, e.element);
},
});
dateTimeInstance.appendTo('#' + args.elements.id);
}
}
},