Comparator to sort the array of dates
function myCompare ( date1 , date2 ) { var day1 = date1 . substr ( 0 , 2 ) ; var month1 = date1 . substr ( 3 , 2 ) ; var year1 = date1 . substr ( 6 , 4 ) ; var day2 = date2 . substr ( 0 , 2 ) ; var month2 = date2 . substr ( 3 , 2 ) ; var year2 = date2 . substr ( 6 , 4 ) ;