bricolagezero2
Posts: 13
Joined: Fri May 27, 2022 5:48 pm

Convert Date Format

Hello!

All of my data contains dates in this format, and it's a lot to change manually:

start: '2021-12-17',
end: '2021-12-17',

So my Gantt chart is rendering properly. Is there some way to parse the date and time to:

start: Date.UTC(YYY MM, DD),
end: Date.UTC(YYYY, MM, DD),

Instead?

Thank you so much.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Convert Date Format

Hello,

We appreciate you reaching out to us!

You can convert the date format in data using the JavaScript array map() method combined with Date() object.
Demo: https://jsfiddle.net/BlackLabel/rkLu20e8/

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Gantt”