Angular.js ui-grid custom date filter

后端 未结 4 627
抹茶落季
抹茶落季 2021-02-09 09:51

I am using the angular grid, ui-grid, located at ui-grid.info.

I am trying to make a custom filter that will filter the grid by date using date inputs controls, one for

4条回答
  •  不思量自难忘°
    2021-02-09 10:27

    i have done it using a custom javascript method

    condition: function(term, value){
        if (!term) return true;
        var valueDate = new Date(value);
        var replaced = term.replace(/\\/g,'');
        var termDate = new Date(replaced);
        return valueDate < termDate;
    },
    placeholder: 'less than'
    

提交回复
热议问题