Type detection with null values

Type detection with null values

alexnaudalexnaud Posts: 1Questions: 1Answers: 0

Hi,

I have a problem with column detection type for european date format.

The problem is that I can have some null values in the date column. When I have a date the detection is ok but the function _fnColumnTypes check all values in a "for" loop and if only one date is null, the type is not put in the col.sType variable (line 852 of jquery.datatable.js).

jQuery.fn.dataTableExt.aTypes.unshift(
function (sData) {

    if (sData !== null && sData.match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/\d\d\d\d$/)) {
        return 'date-eu';
    }

    return null;
}

);

Thanks for your help

This discussion has been closed.