Our date data comes to us as YYYY=MM-DD.
We discovered by accident that CanvasJS.formatDate('2017-08-30','MMM D, YYYY')
will output Aug 29, 2017, not Aug 30…
However CanvasJS.formatDate('2017-08-30 00:00:01','MMM D, YYYY')
will output Aug 30, 2017.
In setting our title we began using
axisXOption.title = CanvasJS.formatDate(json.dataset.start_date + ' 00:00:01','MMM D, YYYY') + ' to ' + CanvasJS.formatDate(json.dataset.end_date + ' 00:00:01','MMM D, YYYY');
Works in MS Edge, Chrome, FF etc. However we find that in IE 11 and previous we see
SCRIPT5022: Exception thrown and not caught canvasjs.min.js (67,13)
We will add some error handling on our end but can you advise as to how we get correct, formatted dates without this invalid date issue in IE 11?
http://jsfiddle.net/9vkjpegs/1/ will show xAxis title on Chrome/FF/MS Edge. On IE 11 (line 154 of fiddle)
http://jsfiddle.net/9vkjpegs/ will work in IE 11 due to commented out line 154