|
|
@ -27,12 +27,17 @@ $.fn.dataTable.moment = function ( format, locale ) {
|
|
|
|
|
|
|
|
|
|
|
|
// Add type detection
|
|
|
|
// Add type detection
|
|
|
|
types.detect.unshift( function ( d ) {
|
|
|
|
types.detect.unshift( function ( d ) {
|
|
|
|
|
|
|
|
// Strip HTML tags if possible
|
|
|
|
|
|
|
|
if ( d && d.replace ) {
|
|
|
|
|
|
|
|
d = d.replace(/<.*?>/g, '') ) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Null and empty values are acceptable
|
|
|
|
// Null and empty values are acceptable
|
|
|
|
if ( d === '' || d === null ) {
|
|
|
|
if ( d === '' || d === null ) {
|
|
|
|
return 'moment-'+format;
|
|
|
|
return 'moment-'+format;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return moment( d.replace ? d.replace(/<.*?>/g, '') : d, format, locale, true ).isValid() ?
|
|
|
|
return moment( d, format, locale, true ).isValid() ?
|
|
|
|
'moment-'+format :
|
|
|
|
'moment-'+format :
|
|
|
|
null;
|
|
|
|
null;
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|