app.filter("dateFilter", function(moment) {
  return function(items, from, to) {
    if (!from || !to) {
      return items;
    }

    from = moment(from);
    to = moment(to);
    var result = [];
    for (var i = 0; i < items.length; i++) {
      var date = moment(items[i].data_pagamento);
      if (date >= from && date <= to) {
        result.push(items[i]);
      }
    }
    return result;
  };
});
