[ACS-10246] Enhance the logic for converting date

This commit is contained in:
Shivangi Shree
2026-08-14 16:56:13 +05:30
parent a7f7301473
commit db0ac6c6af
@@ -60,7 +60,11 @@ export class DateCellComponent extends DataTableCellComponent implements OnInit
// Computed signal that automatically formats the date to ISO string for datetime attribute
protected readonly isoDate = computed(() => {
const date = this.dateValue();
return date ? new Date(date).toISOString() : '';
if (date === null || date === undefined || date === '') {
return null;
}
const parsed = new Date(date);
return isNaN(parsed.getTime()) ? null : parsed.toISOString();
});
// Computed signal that automatically formats the date based on value and config