Skip to content

issue when sorting with custom converter #300

@sbalazote

Description

@sbalazote

Hi, guys. i've an issue in which i can't sort by with a custom converter named 'dateARG' in my code, it keeps sorting by string i think.
The format of my custom Date is in format 'DD/MM/YYYY'.

HTML
<th data-column-id="dateARG" data-converter="dateARG"><spring:message code="common.date"/></th>

JS
var table = $("#movementsTable").bootgrid({ caseSensitive: false, converters: { dateARG: { from: function (value) { // converts from string to dateARG return moment(value, "DD/MM/YYYY"); }, to: function (value) { // converts from dateARG to string return moment(value, "DD/MM/YYYY").format("DD/MM/YYYY"); } } } });

the resulting order is:

25/01/2016
27/05/2016
27/05/2016
29/01/2016

Any ideas what could be wrong? Thx!

pd: i'm appending rows with the append() method in client-mode

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