Problem when displaying data within a range of dates

0

I have an input date :

<input id="start" type="date"><label>To</label><input id="end" type="date">

Result with dd-mm-aaaa format:

This is my JS when you press Generate Report :

function Report(fecha1,fecha2)
{
        var fecha1 =document.getElementById("start").value;
        var fecha2 =document.getElementById("end").value;

        setTimeout(function(){ window.open("http://localhost/WareHouse/datereport.php?fecha1="+fecha1+"&fecha2="+fecha2, "_blank"); }, 1000);
        initArticles(); $('#myModalReport').modal('hide');
        console.log(fecha1);
        console.log(fecha2);
}

When executing console.log it is displayed in aaaa-mm-dd format.

Choosing a date range generates a PDF by bringing the data within that range depending on your registration date.

The problem is that the first time I put a range in datepicker , example 05-12-2018 a 12-12-2018 brings me the data that is effectively within that chosen range the PDF is generated correctly and in the lower part its% is shown url with aaaa-mm-dd format, I reload the page and choose again range where only I should show a data and it shows nothing.

In my BD I have the data type date . Printing the query from php comes out, I have 2 records within the ranges shown inside the query, but it does not show them.

Will it be due to the type of format that is being handled? I have not found a solution.

This is the link that appears at the end of the PDF

    
asked by Pato 12.12.2018 в 20:52
source

0 answers