diff --git a/sorting/datetime-moment.js b/sorting/datetime-moment.js index 35af232..aae10d9 100644 --- a/sorting/datetime-moment.js +++ b/sorting/datetime-moment.js @@ -32,7 +32,7 @@ $.fn.dataTable.moment = function ( format, locale ) { return 'moment-'+format; } - return moment( d, format, locale, true ).isValid() ? + return moment( d.replace ? d.replace(/<.*?>/g, '') : d, format, locale, true ).isValid() ? 'moment-'+format : null; } ); @@ -41,7 +41,7 @@ $.fn.dataTable.moment = function ( format, locale ) { types.order[ 'moment-'+format+'-pre' ] = function ( d ) { return d === '' || d === null ? -Infinity : - parseInt( moment( d, format, locale, true ).format( 'x' ), 10 ); + parseInt( moment( d.replace ? d.replace(/<.*?>/g, '') : d, format, locale, true ).format( 'x' ), 10 ); }; };