I have a script that is already works which moves the rows to another sheet if it's older than 90 days from today. but what I'm trying to work is to move the row if the date is older than previous month of every 20th.
E.g. If today is March 20th, then i want to move the rows that is older than January 20th.
I tried playing around with number but it didn't work for me. can i get a support here?
function moveRows90DaysOld() {
var v=new Date().valueOf()-(1000 * 60 * 60 * 24 * 90);
var ss=SpreadsheetApp.getActive();
var sh=ss.getSheetByName('MAIN');
var tsh=ss.getSheetByName('Archive');
var rg=sh.getDataRange();
var vA=rg.getValues();
var d=0;
for(var i=2;i<vA.length;i++) {
if(new Date(vA[i][0]).valueOf()<v) {
tsh.appendRow(vA[i]);
sh.deleteRow(i+1-d++);
}
}
}