I'm trying to use d3.timeFormat() to convert a date formatted like this: 2017-09-19T00:00:00 to a more readable: Sep 19, 2017. I've tried numerous variations on the following code with no luck:
.append('td')
.text(function (d, i) {
if (i === 0) {
var parseDate = d3.timeFormat("%m %d, %Y");
return parseDate(d.value)
}
else {
return d.value;
}
});
Here is what it's returning: 0NaN NaN NaN.
I'm guessing that the value I have is a string, and I need to convert it to a date/time object that can then be rendered/formatted as desired, but I can't figure out how to make it work? Then again, I could be wrong, as I'm a UX guy and not a programmer by trade.
Any help explaining how I should approach this is greatly appreciated. Thanks.