Skip to content

Instantly share code, notes, and snippets.

@MappingKat
Created September 29, 2016 15:41
Show Gist options
  • Save MappingKat/c8e088f5ddeaaf8625854431162ccb0e to your computer and use it in GitHub Desktop.
Save MappingKat/c8e088f5ddeaaf8625854431162ccb0e to your computer and use it in GitHub Desktop.
function loopThrough(records){
var myDateString = Utilities.formatDate(new Date(),"GMT", "yyyy-MM-dd");
for (var i = 0; i < records.length; i++) {
var formattedDate = records[i].updated_at.substr(0, 10);
var now = new Date();
if (formattedDate === myDateString) {
now.setDate(now.getDate() + 30);
var stringDate = Utilities.formatDate(now,"GMT", "yyyy-MM-dd");
updateDate(records[i].id, stringDate);
}
if (records[i]["form_values"]["8302"] === myDateString){
updateStatus(records[i].id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment