JSFiddle - React, Tailwind, and code Playground
JavaScript
this.orders = [
{
"codigo": 1,
"fecha": "2018-01-18",
"mes": "x",
"ano": "xx",
"f_entrega": "xx",
"observaciones": "xx",
"total_eu": "x",
"nombre_fiscal": "xxx",
"nombre_comercial": "xxx",
"num_pedido": "xxx"
},
{
"codigo": 2,
"fecha": "2015-05-25",
"mes": "x",
"ano": "xx",
"f_entrega": "xx",
"observaciones": "xx",
"total_eu": "x",
"nombre_fiscal": "xxx",
"nombre_comercial": "xxx",
"num_pedido": "xxx"
}
]
var startDate = new Date("2013-3-25");
var endDate = new Date("2017-3-25");
var aDate = new Date();
var filteredData = this.orders.filter(function(a){
aDate = new Date(a.fecha);
console.log("aDate: "+aDate);
console.log("startDate: "+startDate);
console.log("endDate: "+endDate);
aDate >= startDate && aDate <= endDate;
});
console.log(filteredData)