user2010343
user2010343

Reputation: 1

Morris.js number and date format

I'm using morris.js line charts. I'd like to display dates as dd/mm/YYYY instead of YYYY-mm-dd. Is it possible? I'm also using time such as 01.00.56, 00.55.44 etc. but this format is not recognized. How can I display time of the format (minutes.seconds.milliseconds)? Any help would be appreciated.

This is my data

var data = [
  { y: '20-05-2014', a: 01.00.45},
  { y: '17-06-2015', a: 00.56.20}
],

Thanks

Upvotes: 0

Views: 838

Answers (1)

Pierre
Pierre

Reputation: 1246

I suggest you to try the function dateFormat.

From the help:

A function that accepts millisecond timestamps and formats them for display as chart labels. default: function (x) { return new Date(x).toString(); }

Upvotes: 0

Related Questions