0
I have the following question. I have to capture two dates, one being today and the other being 15 days back. To get the date of the day I did the following.
function dateFormat() {
var initialDate = new Date(),
day = initialDate.getDate(),
month = initialDate.getMonth() + 1,
year = initialDate.getFullYear();
return (year * 10000) + (month * 100) + day; }
I can get today’s date without problems, but how should I get a date 15 days ago. Since there is the difference of days between the months.
Note the value of Return function is due to how I should send this date to the server, as it should go as YYYYMMDD.
You want to take the date back and do what in function?
– Sam
I have to get the data from a table that changes daily and I’m creating a filter that takes the data from the last 15 days.
– Marcus Botelho