Tuesday 17 January 2012

jqPlot, IE7, dateAxisRendering and "Object doesn't support property or method 'getTime'"

I am using the excellent graphing library jqPlot and as most people (I expect) I develop in Chrome but unfortunately have to deploy to IE. IE7 of all things. Anyway, jqPlot allows you to specify your axis as textual dates and interprets them, and handles them correctly (i.e. spacing and showing a sane number of ticks). The problem is that in Chrome the X label can be "2011-Dec-1" but in IE (7 and 9) that generates "Object doesn't support property or method 'getTime'". Changing the text to '2011-12-01' works and it seems to be hard coded to be year, month and day so localisation issues aren't a concern....