Skip to content

emptyTo not working with custom parser #1278

@ghost

Description

empty or emptyTo seem to be working correctly, but not if applied to a column with a unique parser. My parser is as follows, if that helps:

$.tablesorter.addParser({
    id: 'pihmsDate',
    is: function(s){
        return false;
    },
    format: function(s){
        s = s.replace(/JAN/,01).replace(/FEB/,02).replace(/MAR/,03).replace(/APR/,04).replace(/MAY/,05).replace(/JUN/,06).replace(/JUL/,07).replace(/AUG/,08).replace(/SEP/,09).replace(/OCT/,10).replace(/NOV/,11).replace(/DEC/,12);
        s = s.replace(/(\d{2})[\/\-](\d{1,2})[\/\-](\d{4})/, '$3/$2/$1');
        return $.tablesorter.formatFloat(new Date(s).getTime());
    },
    type: 'numeric'
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions