diff --git a/sorting/datetime-moment.js b/sorting/datetime-moment.js index c9cdded..ae0cce5 100644 --- a/sorting/datetime-moment.js +++ b/sorting/datetime-moment.js @@ -65,8 +65,8 @@ $.fn.dataTable.moment = function ( format, locale ) { d = $.trim( d ); } - return d === '' || d === null ? - -Infinity : + return !moment(d, format, locale, true).isValid() ? + Infinity : parseInt( moment( d, format, locale, true ).format( 'x' ), 10 ); }; };