I know there are some questions that looks similar to this, but I'm scratching my head with the specific necessity I have.
I have one GoogleSheet Column with automatic imported dates in each row like this (European dates): 22/04/2020, 23/04/2020, 24/04/2020, 28/04/2020. (one row is comma-separated for the example). On another column I have the day of the week with an arrayformula function:
PROPER(TEXT(B5:B;"DDDD"))
My function on Google App Script is creating an array with all the dates associated with the name of the day
let numberOfDates = currentSheet.getRange(5,1).getValue(); // I have the number of dates written on the Sheet, I just get the value
let arrayDates = [];
for (let i=0;i<numberOfDates;i++){
arrayDates.push([currentSheet.getRange(5+i,2).getValue(),currentSheet.getRange(5+i,3).getValue()]);
}
If I do Logger.log on the array, this is the type of value it will return
[[Wed Apr 22 00:00:00 GMT+02:00 2020, Wednesday], [Thu Apr 23 00:00:00 GMT+02:00 2020, Thursday], [Fri Apr 24 00:00:00 GMT+02:00 2020, Friday], [Tue Apr 28 00:00:00 GMT+02:00 2020, Tuesday]]
Now I also need to have Monday 27/04/2020 in this Array because I'm going to create a planning. The thing is I don't want to confuse what is added from what is the source so in the end, all added dates I will put them in red for example.
Sometimes, the set of dates at the source will be over a month and I will want to put in the mix all the dates in-between except Saturday and Sunday.
I guess it is complex, but maybe you could hit me with a solution on how to create this Array ?
Thank you very much !