From 3c731d416e3d2c7af59258f866930bbdfcedb853 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 7 May 2020 10:17:24 +0000 Subject: [PATCH] Renderer: moment - allow for empty values --- dataRender/datetime.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dataRender/datetime.js b/dataRender/datetime.js index a619431..c866f97 100644 --- a/dataRender/datetime.js +++ b/dataRender/datetime.js @@ -106,6 +106,10 @@ $.fn.dataTable.render.moment = function ( from, to, locale ) { } return function ( d, type, row ) { + if (! d) { + return type === 'sort' || type === 'type' ? 0 : d; + } + var m = window.moment( d, from, locale, true ); // Order and type get a number value from Moment, everything else