Poll David
Posts: 0
Joined: Sat Jan 24, 2015 5:22 am

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;

&#47;&#47;You should replace true with your condition&#46;
var currentCondition = value&#46;start_date < today;
if(currentCondition)
currentLi&#46;addClass("liStrikethrough");
return value;/code

Return to “Issues”