function compareDashedDates(date1, date2) {
    date1 = date1.split('-');
    date2 = date2.split('-');
    for (let i = 0; i < date1.length; i++) {
      if (parseInt(date1[i]) < parseInt(date2[i])) {
        return true;
      } else if (parseInt(date1[i]) > parseInt(date2[i])) {
        return false;
      }
    }
  }
// takes two string respresentations of dates in format "YYYY-MM-DD"
takes two string respresentations of dates in format "YYYY-MM-DD"
takes two string respresentations of dates in format " YYYY - MM - DD "
function compareDashedDates(date1, date2) {
    date1 = date1.split('-');
    date2 = date2.split('-');
    for (let i = 0; i < date1.length; i++) {
      if (parseInt(date1[i]) < parseInt(date2[i])) {
        return true;
      } else if (parseInt(date1[i]) > parseInt(date2[i])) {
        return false;
      }
    }
  }
function compareDashedDates ( date1 , date2 ) { date1 = date1 . split ( '-' ) ; date2 = date2 . split ( '-' ) ; for ( let i = 0 ; i < date1 . length ; i ++ ) { if ( parseInt ( date1 [ i ] ) < parseInt ( date2 [ i ] ) ) { return true ; } else if ( parseInt ( date1 [ i ] ) > parseInt ( date2 [ i ] ) ) { return false ; } } }
takes two string respresentations of dates in format "YYYY-MM-DD"
takes two string respresentations of dates in format " YYYY - MM - DD "