Due date day-2
Due date day-2
Hello everybody,
I would like to put a color on dates whose term arrives in 2 days.
Here is what I did for a date greater than today's date.
rowCallback: function (row, data, index) {
if (data[6] < moment().format('DD/MM/YYYY')) {
$(row).find('td:eq(6)').css('background-color', '#f0aaaa').css('font-weight', 'bold')
}
},
Thank's
Answers
Maybe use the moment.js add() method.
Kevin
Thank's Kevin.
So I had to substract 2 days from the columns data [6] like this
rowCallback: function (row, data, index) {
if (data[6] == moment(data[6]).add(-2, 'days')) {
$(row).find('td:eq(6)').css('background-color', '#ff7f00').css('font-weight', 'bold')
}
},