Comparing the dates between from date and to date not working as expected

Comparing the dates between from date and to date not working as expected

I need to compare the from date and to date in cloned rows. For example:

  • If I select from date as 12/01/2007 and to date as 12/01/2005 an alert should come your from date is greater than to date.
  • If the user click add row button in the from date if the user gave 12/11/2004 and the to date as12/17/2015 it should say from date is greater than previous to date.
  • If both dates are correct for example 12/01/2000 to 12/12/2002 I should get the total no of exp in the top label (this was working with my current code.)

The point number first and two was working for the first time if the user correct the date value once again in the second row. I am still getting alert message says from date is greater than the previous date :( I am not getting the total no of exp for the cloned row.

Here is the code where I am checking for the date comparison

https://jsfiddle.net/karthic2914/h5qumm2u/

Thanks in advance