So, I already have a variable that holds all the cells in a certain column. each cell contains, as it's innerText, a timestamp formatted like such, yyyy-mm-dd hh:mm in 24h format.
How do I go about comparing the string that I have with Date() to see if the string is within the next hour?
I was thinking a for loop to go through the array with an if function inside saying "if the time shown is within an hour of the current time then change the background color of the cell to red.
for(var i=0; i<column.length;i++){
if(column[i].innerText - Date() < 1hr){ //this line needs work
column[i].style.backgroundColor='#ff000';
} else(){
}
};
I'm sure there probably needs to be some parse method used or something but I'm not too familiar with it.
note: I'm using Tampermonkey to inject the code into a page I have no control over and so the timestamps are as the come.