Sorting: Fix mix of tabs and spaces for datetime-moment plug-in

- Also use $.trim for whitespace removal. We've got jQuery, so might as
  well use it for compatibility
pull/295/head
Allan Jardine 8 years ago
parent 0e201c0016
commit 280402d05e

@ -38,10 +38,9 @@ $.fn.dataTable.moment = function ( format, locale ) {
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
@ -61,10 +60,9 @@ $.fn.dataTable.moment = function ( format, locale ) {
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 ?

Loading…
Cancel
Save