Bind Gantt to momen.js date?

Hi

 My API is generated by Swagger (Nswag) which converts Datetime into moments (moment.js), when trying to bind to the gantt chart i get a "core.js:5882 ERROR TypeError: value.match is not a function" (Works fine using regular js Date obj. )

Is there a way to bind the gantt char to an array containing moment dates?

 (Same issue.. but not an easy applicable fix for my problem: https://www.syncfusion.com/forums/140402/date-binding-to-moment-js)


1 Reply

KR Karthikeyan Raja Syncfusion Team March 16, 2020 03:11 PM UTC

Hi Marius, 
 
We have analyzed your query and able to reproduce the reported issue. By bind the date values as string we can resolve the reported issue. Please find the code snippet below, 
[app.component.ts] 
this.data = [ 
{ 
   TaskID: 1, 
   TaskName: 'Project initiation', 
    StartDate: moment('04/02/2019', "DD.MM.YYYY").toDate(), 
    EndDate: moment('04/21/2019',"DD.MM.YYYY").toDate(), 

 
We have prepared sample with your requirement. Please find the sample from below link, 
 
Please get back to us, if you need any further assistance on this. 
 
Regards,  
Karthikeyan Raja 


Loader.
Up arrow icon