learn.forge.viewhubmodels icon indicating copy to clipboard operation
learn.forge.viewhubmodels copied to clipboard

Improve version ordering

Open augustogoncalves opened this issue 6 years ago • 0 comments

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;
    }

augustogoncalves avatar Aug 16 '18 14:08 augustogoncalves