I trying to create a new date object for an ngx-chart following this example, specifically this code:
constructor() {
this.data = this.multi.map(group => {
group.series = group.series.map(dataItem => {
dataItem.name = new Date(dataItem.name);
return dataItem;
});
return group;
});
console.log(this.data);
}
I understand using new Date()as seen here but I keep getting this error: "Type 'Date' is not assignable to type 'string'." Which I also understand (because this is typescript), I just don't get how I am supposed to handle these two together. In the other examples I've seen this doesn't seem to be an issue.