$.fn.dataTable.render.datetime combine with render: function(data, type, row)
$.fn.dataTable.render.datetime combine with render: function(data, type, row)
Loren Maxwell
Posts: 387Questions: 94Answers: 10
in Plug-ins
Similar to this post: https://datatables.net/forums/discussion/comment/134939/
I'd like to pass the data through to the datetime plugin, such as making a sentence with the date rendered in a specific format:
var datetimeRenderer = $.fn.dataTable.render.datetime().display;
render: function(data, type, row){
return 'From ' + datetimeRenderer( row.start_date, 'MMM DD, YYYY') + ' to ' + datetimeRenderer( row.end_date, 'MMM DD, YYYY');
}
}
However looks like the plugin as written won't allow me to pass a parameter in the same way that I can with the text renderer.
Am I correct or overlooking something?
This discussion has been closed.
Answers
I'm waaaaay overthinking this, aren't I?
Is it just as simple as using the moment.js library directly?