I'm trying to set a default value if startDate and endDate doesn't exist on the value. I've tried it on my code, but didn't worked.
On my code if the value exists it return the date formated correctly, but if doesn't exist it returns nothing (It must return "-" on startDate or endDate)
footerItems: {
startDate: {
type: "template",
template: ({ value }: any) => {
console.log(value);
const formattedStartDate = value ? DateHelper.format(value, "DD/MM/YYYY") : "-";
return `<div> "startDate:" </div> ${formattedStartDate}`;
},
},
endDate: {
type: "template",
template: ({ value }: any) => {
const formattedEndDate = value ? DateHelper.format(value, "DD/MM/YYYY") : "-";
return `<div> "endDate:" </div> ${formattedEndDate}`;
},
},
},