function compareRangeValue()

in src/data.ts [220:233]


function compareRangeValue(a: any, b: any) {
    const isNumeric = (n: any) => !isNaN(parseFloat(n)) && isFinite(n);
    let aValue: any = Date.parse(a);
    let bValue: any = Date.parse(b);
    const isNumberOnly = isNumeric(a) && isNumeric(b);
    const isNotValidDate = isNumberOnly || isNaN(aValue) || isNaN(bValue);
    if (isNotValidDate) {
        aValue = isNumberOnly ? parseFloat(a) : a;
        bValue = isNumberOnly ? parseFloat(b) : b;
    }
    if (aValue > bValue) { return 1; }
    if (aValue < bValue) { return -1; }
    return 0;
}