Link to test case: https://jsfiddle.net/BeerusDev/940cedtm/8/
I am trying to use the createdRow callback to style the base row, removed rowgroup and everything unneccessary to this application, to have less eye strain on the code. I am trying to apply a styling to the base row based on if the Current Date (Today) is before one month before the retention date, if it isn't then it will style it red, but if it is it should be green.
The date itself is so it should be green, but I am getting a red output.
"createdRow": function( row, data, dataIndex){
let notiDate = moment(data[5]).subtract(1, 'months').format("MM/DD/YYYY");
if(moment(data[7]).isBefore(notiDate)){
$(row).addClass('green');
}
if(moment(data[7]).isAfter(notiDate)){
$(row).addClass('red');
}
},
Here is a different, sort of similar attempt still returning red: https://jsfiddle.net/BeerusDev/940cedtm/14/