Compare two date in table columns and perform functions
Dear jQuery Gurus and friends,
I am new in jQuery, i need your help to solve one task.
I have a data table, there are two columns of dates (a target date and actual date).
- If actual date column is blank and date past from targeted date, run function 1 (overdue)
- If actual date column filled and date past from targeted date, run function 2 (Late completed)
- If actual date is happened before targeted date, run function 3 (completed)
- If actual date blank, run function 4 (under process)
- var target_Date = jQuery("table tbody tr > td:nth-child(9)").val(); var actual_Date = jQuery("table tbody tr > td:nth-child(11)").val(); if (target_Date > actual_Date) { jQuery("table > tbody > tr > td:nth-child(13)").html('<img src="/images/2.GIF">'); } else if (target_Date < actual_Date) { jQuery("table > tbody > tr > td:nth-child(13)").html('<img src="/images/1.GIF">'); } else if (target_Date == actual_Date) { jQuery("table > tbody > tr > td:nth-child(13)").html('<img src="/images/0.GIF">'); } else { jQuery("table > tbody > tr > td:nth-child(13)").html('Today is Today'); }
I much appreciate your feedback and support from deep heart
Regards,