Is it possible to list dates, highlight those that are due?
To make it easier to locate them.
For example
2016-10-29
2016-10-01
2016-10-29
2016-10-29
2016-10-29
2016-10-29
That the date 2016-10-01 is highlighted in red
Is it possible to list dates, highlight those that are due?
To make it easier to locate them.
For example
2016-10-29
2016-10-01
2016-10-29
2016-10-29
2016-10-29
2016-10-29
That the date 2016-10-01 is highlighted in red
What you should do basically is to compare the date to determine if it is less than the current one and if so, apply a css class with which you customize the styles.
function esMenorQueFecha(fecha1) {
return fecha1 < new Date();
}
var fechaComoString = '2016-10-01';
var newDiv = document.createElement("div");
var newContent = document.createTextNode(date);
if(esMenorQueFecha(new Date(fechaComoString))) {
newContent.className = 'menor';
}
newDiv.appendChild(newContent);
css
.menor {
color: red;
}