From db0ac6c6af25dbd8ffa96b1fea7bc3ae0c1cdfd9 Mon Sep 17 00:00:00 2001 From: Shivangi Shree Date: Fri, 14 Aug 2026 16:56:13 +0530 Subject: [PATCH] [ACS-10246] Enhance the logic for converting date --- .../datatable/components/date-cell/date-cell.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/src/lib/datatable/components/date-cell/date-cell.component.ts b/lib/core/src/lib/datatable/components/date-cell/date-cell.component.ts index d913f6b3b4..b071dfa1b9 100644 --- a/lib/core/src/lib/datatable/components/date-cell/date-cell.component.ts +++ b/lib/core/src/lib/datatable/components/date-cell/date-cell.component.ts @@ -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