Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve version ordering #9

Open
augustogoncalves opened this issue Aug 16, 2018 · 0 comments
Open

Improve version ordering #9

augustogoncalves opened this issue Aug 16, 2018 · 0 comments

Comments

@augustogoncalves
Copy link
Contributor

augustogoncalves commented Aug 16, 2018

Need to apply standard from server side, using vX: dd/mm/aaaa hh:mm by author

    "sort": function (a, b) {
      var a1 = this.get_node(a);
      var b1 = this.get_node(b);
      var parent = this.get_node(a1.parent);
      if (parent.type === 'items') {
        var id1 = Number.parseInt(a1.text.substring(a1.text.indexOf('v') + 1, a1.text.indexOf(':')))
        var id2 = Number.parseInt(b1.text.substring(b1.text.indexOf('v') + 1, b1.text.indexOf(':')));
        return id1 > id2 ? 1 : -1;
      }
      else return a1.text > b1.text ? 1 : -1;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant