My JSON date is coming in as UTC e.g.
I put a YYYY-MM-DD format on a column and it formats fine.
But when I change the format to DD-MM-YYYY, it breaks. I am trying to add the columns dynamically, here's the config:
{
type = 'date';
filterType = 'date';
format = 'YYYY-MM-DD';
rendererFunc = ({ record }: any) => {
const date: string = 2022-09-04T15:39:53.5924312+02:00; //Dummy data
return date ? DateHelper.format(new Date(date), 'DD.MM.YYYY') : '';
};
};
This code works fine i.e. when I try to edit the column, it shows the date in YYYY-MM-DD format, and in DD.MM.YYYY format otherwise.
Now, when i changed the format in column config above to DD.MM.YYYY or DD/MM/YYYY, the code breaks.
I want the format to remain constant i.e. (DD.MM.YYYY) in both the cases(while editing, and otherwise also)