$.each(MyData, function (i, n) { var NowDate = new Date(); var UpdateDate = n.UpdateTime; var dt2 = new Date(Date.parse(UpdateDate.replace(/-/g, '/'))); var datedeff = NowDate - dt2; var days = Math.floor(datedeff / (24 * 3600 * 1000)); if (days <= 3)