I have a google sheet with rows that have some date values and other info to place on a gCal.
Date
9/4/2019
9/6/2019
9/5/2019
I am trying to run a loop that will only pull dates that are equal to a futureDate (which is today plus three days, currently 09/05/2019)
If I use the <= or => it works fine. Pulls the correct dates and places them on my calendar. I can't get the equal to futureDate to work. I have spent hours thinking it has something to do with the date format but then the <= should not work either. What am I missing here??
var today = new Date();
var futureDate = new Date();
futureDate.setDate(today.getDate()+3);
for(var i = 0; i<data.length; i++){
if(data[i][11] == futureDate) {
cal.createEvent(data[i][0], data[i][1], data[i][2], {location: data[i][3], description: data[i][10]}).setColor(data[i][5]);
//This one works and returns all dates that are not equal to futureDate
if(data[i][11] <= futureDate) {
cal.createEvent(data[i][0], data[i][1], data[i][2], {location: data[i][3], description: data[i][10]}).setColor(data[i][5]);
I need only 09/05/2019 to return currently because today is 09/02/2019. (today + 3 days)