Apply condition according to date jquery

Apply condition according to date jquery

I try to conditions in date cell like if date in cell is 02-12-2016 then want to apply yellow color untill this date comes and want to apply red color when this date expires how i do that

this is what i try <script type="text/javascript"> $(function () { debugger; var ID = '<%=Session["value"]%>'; debugger; var obj = {}; obj.ID = ID; getremin(obj); }); function getremin(obj) { var get_remin = {}; get_remin.ID = obj.ID; $.ajax({ type: "POST", url: "M.aspx/sp_select", data: JSON.stringify(get_remin), contentType: "application/json;charset=utf-8", dataType: "json", success: function (result) { debugger; var b = JSON.parse(result.d).response; console.log(JSON.parse(result.d).response); debugger; var remind = $("#table").DataTable({ "dom": "Blfrtip", "columns": [ { "title": "Type", "data": "Type" }, { "title": "date", "data": "date", "visible": false }, { "title": "mile", "data": "mile", "visible": false }, { "title": "Required by", "render": function (data, type, row) { return row.date + ' ' + row.mile } }, { "title": "RType", "data": "RType" } ], "columnDefs": [ { targets: 2, className: 'last-column' } ] }); debugger; for (var i = 0; i < b.length; i++) { if (b[i] !== null) { remind.row.add({ "type": b[i][0], "date": b[i][1], "mile": b[i][2], "RType": b[i][3] }) } } debugger; remind.draw(); }, error: function (error) { debugger; var r = error.responseText; var errorMessage = r.Message; alert(errorMessage); alert(r); alert(Error); } }); }; </script>