I am generating a prototype of a page of orders, some of the data of the order is the date which income, which I get in the following way in string
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //Enero es 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd;
}
if(mm<10){
mm='0'+mm;
}
var today = yyyy+'-'+mm+'-'+dd;
console.log(today);
And I add it to a table as follows
function mostrarListaPedidos(){
$("#listaDePedidos").empty();
var tabla="<table border='2px'>"
tabla+="<tr><th>Número</th><th>Cliente</th><th>Dirección</th><th>Teléfono</th><th>Fecha de alta</th><th>Plato</th><th>Cantidad</th><th>Precio unitario</th><th>Estado</th><th>Precio total</th></tr>"
for (var i=0;i<arregloPedidos.length;i++) {
var pedido=arregloPedidos[i];
var fila="<tr><td>"+pedido.numero+"</td><td>"+pedido.cliente+"</td><td>"+pedido.direccion+"</td><td>"+pedido.telefono+"</td><td>"+pedido.fechaDeAlta+"</td><td>"+pedido.plato+"</td><td>"+pedido.cantidad+"</td><td>$"+pedido.precioUnitario+"</td><td style='font-style: oblique;'>"+pedido.estado+"</td><td>$"+pedido.precioTotal+"</td></tr>"
tabla+=fila
}
tabla+="</table>"
$("#listaDePedidos").append(tabla);
}
What I need to do is put two inputs of type date where you can choose an initial and final date, and search all the orders between those two dates entered, I have no idea how to do it, so I ask without having tried to do a code!