JSFiddle - React, Tailwind, and code Playground
JavaScript
(function() {
var time;
var buttonParent = document.getElementsByClassName("sx_dd4f23")[0].parentElement;
time = document.getElementsByClassName("uiStreamSecondaryTime")[0].getAttribute("aria-label");
timeD = time.split(" ")[3].split(",")[0];
timeM = time.split(" ")[2];
buttonParent.click();
setTimeout(function() {
document.getElementsByName("backdated_date[day]")[0].value = timeD;
document.getElementsByName("backdated_date[month]")[0].value = getMonthFromString(timeM);
document.getElementsByName("save")[0].click();
setTimeout(function() {
document.getElementsByClassName("photoPageNextNav")[0].click();
}, 2000);
},1000);
})();
function getMonthFromString(mon){
return new Date(Date.parse(mon +" 1, 2015")).getMonth()+1
}