mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-02 17:53:30 +00:00
[ACS-10246] Enhance the logic for converting date
This commit is contained in:
@@ -60,7 +60,11 @@ export class DateCellComponent extends DataTableCellComponent implements OnInit
|
|||||||
// Computed signal that automatically formats the date to ISO string for datetime attribute
|
// Computed signal that automatically formats the date to ISO string for datetime attribute
|
||||||
protected readonly isoDate = computed(() => {
|
protected readonly isoDate = computed(() => {
|
||||||
const date = this.dateValue();
|
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
|
// Computed signal that automatically formats the date based on value and config
|
||||||
|
|||||||
Reference in New Issue
Block a user