I have a sharepoint discussion list. There's a field called "Last Updated". I'm trying to highlight rows where last updated is greater than 1 hour.
This is what I'm currently trying:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https:////cdnjs.cloudflare.com/ajax/libs/moment.js/2.6.0/moment.min.js"></script>
<script>
$(document).ready(function(){
var now = moment().format('l h:mm:ss a');
console.log(now);
//$row = $("td .ms-vb2:contains('6/13/2014 9:46 AM')");
$rows = $("td[id$='WPQ3'] .ms-vb2:contains('AM'), td[id$='WPQ3'] .ms-vb2:contains('PM')");
console.log($rows);
$times = $rows.children
$rows.parent().css("background-color", "rgba(203, 231, 57, 0.37)");
});
</script>
</head>
</html>
Right now, every cell is highlighted based on my selector.
$rows contains 2 objects and the innerText for both objects contains the time, so something like "6/13/2014 9:46 AM".
I'm not sure how to look at the time for each row, compare it with the now
variable and then highlight if my condition is met, which is "Highlight if less than 1 hour difference"