|
|
@ -35,14 +35,13 @@ $.fn.dataTable.moment = function ( format, locale ) {
|
|
|
|
types.detect.unshift( function ( d ) {
|
|
|
|
types.detect.unshift( function ( d ) {
|
|
|
|
if ( d ) {
|
|
|
|
if ( d ) {
|
|
|
|
// Strip HTML tags and newline characters if possible
|
|
|
|
// Strip HTML tags and newline characters if possible
|
|
|
|
if ( d.replace ) {
|
|
|
|
if ( d.replace ) {
|
|
|
|
d = d.replace(/(<.*?>)|(\r?\n|\r)/g, '');
|
|
|
|
d = d.replace(/(<.*?>)|(\r?\n|\r)/g, '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Strip out surrounding whitespace if possible
|
|
|
|
|
|
|
|
if ( d.trim ) {
|
|
|
|
// Strip out surrounding white space
|
|
|
|
d = d.trim();
|
|
|
|
d = $.trim( d );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Null and empty values are acceptable
|
|
|
|
// Null and empty values are acceptable
|
|
|
|
if ( d === '' || d === null ) {
|
|
|
|
if ( d === '' || d === null ) {
|
|
|
@ -57,15 +56,14 @@ $.fn.dataTable.moment = function ( format, locale ) {
|
|
|
|
// Add sorting method - use an integer for the sorting
|
|
|
|
// Add sorting method - use an integer for the sorting
|
|
|
|
types.order[ 'moment-'+format+'-pre' ] = function ( d ) {
|
|
|
|
types.order[ 'moment-'+format+'-pre' ] = function ( d ) {
|
|
|
|
if ( d ) {
|
|
|
|
if ( d ) {
|
|
|
|
// Strip HTML tags and newline characters if possible
|
|
|
|
// Strip HTML tags and newline characters if possible
|
|
|
|
if ( d.replace ) {
|
|
|
|
if ( d.replace ) {
|
|
|
|
d = d.replace(/(<.*?>)|(\r?\n|\r)/g, '');
|
|
|
|
d = d.replace(/(<.*?>)|(\r?\n|\r)/g, '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Strip out surrounding whitespace if possible
|
|
|
|
|
|
|
|
if ( d.trim ) {
|
|
|
|
// Strip out surrounding white space
|
|
|
|
d = d.trim();
|
|
|
|
d = $.trim( d );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return d === '' || d === null ?
|
|
|
|
return d === '' || d === null ?
|
|
|
|
-Infinity :
|
|
|
|
-Infinity :
|
|
|
|