Skip to content

Add key string to custom Sort parameters for reuse of sorting function #65

Description

@MishiRover

Would it be possible to add a key definition to the custom sort parameters so that we are able to reuse the sort function for multiple columns? This would be useful for 2+ date columns, for example.

dateSort(a, b, sortOrder, key) {
        let date1 = new Date(a[key]);
        let date2 = new Date(b[key]);

        if (date1 === date2) {
            return 0;
        }

        if (date1 > date2) {
            return 1 * sortOrder;
        }

        return -1 * sortOrder;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions