BillyMedia
BillyMedia

Reputation: 1354

Firefox / IE formatting dates as 1970

I have a dataset (csv) that renders into a line graph, there is also a tool tip that displays amongst other data, the date from the dataset. In chrome it works ok, but in IE (latest) and firefox 58, it is rendering the date as '01 Jan 1970'. I assume that if the date displays ok in Chrome, other browsers would follow suit. This is my tooltip line:

<div class="tooltip-date">' + Highcharts.dateFormat('%d %b %Y', this.x) + '</div>

Has anyone any idea as to how to fix this?

The date in the csv is like so: 25-Jan-2016

I have the latest versions of highchart js and highcharts data module.

Upvotes: 0

Views: 78

Answers (1)

Samuel Vaillant
Samuel Vaillant

Reputation: 3847

The value provided to Highcharts.dateFormat must be a timestamp as a number. From what I understand from your explanation the provided value is a 25-Jan-2016. You have to first parse the date either with Highcharts or before to be able to use the dateFormat function.

Upvotes: 1

Related Questions