Help! Put Strikethrough on List items when Start date inside the list passed the current date.
Here's What I have on the JS Mapping
codeelement.attr("selectedId", value._id);
var name = value.start_date + " - " + value.event_name;
element.find("h3").text(name);
var currentLi = element.closest("li");
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd;
}
if(mm<10) {
mm='0'+mm;
}
today = mm+'/'+dd+'/'+yyyy;
//You should replace true with your condition.
var currentCondition = value.start_date < today;
if(currentCondition)
currentLi.addClass("liStrikethrough");
return value;/code