IE displaying timespan in jquery datatables using moment

315 views Asked by At

I've got it working in firefox but running it in IE9-11 or chrome just error's stating,

"SCRIPT438: Object doesn't support property or method 'replace' File: moment.min.js, Line: 6, Column: 4546"

Below is the column code,

{
   data: "CallTime",
   title: "Time",
   classname: "CallTime",
   render: function (data) {
       return moment(data, String).format('HH:mm');
   }
},

I'm using DataTables 1.10.4 and moment 2.10.3 but wondering if the only solution is to change the field to be datetime and format the display/input for time.

I have also tried just doing "return moment(data).format('HH:mm');" but this just displays "Invalid date".

1

There are 1 answers

0
Myzifer On

Couldn't find any other way to get this to work but to switch the output to be DateTime.Today + CallTime and then to format the datetime to display only time.

Now I need to figure out why the search doesn't work with either the date or time fields.