JSFiddle - React, Tailwind, and code Playground

HTML

<button id="test1">See the Tab Day </button>
<div class="varianceData"></div>

JavaScript

$('#test1').click(function () {

    // Here are the two dates to compare
    var date1 = '29-10-2015';
    var date2 = '29-12-2015';
    var Targetvalue = parseFloat("1000000");
   var dealjson = '[{"dealdate":"25-12-2015","cost":200000},{"dealdate":"25-11-2015","cost":200000}]';

    // First we split the values to arrays date1[0] is the year, [1] the month and [2] the day
    date1 = date1.split('-');
    date2 = date2.split('-');
    
    // Now we convert the array to a Date object, which has several helpful methods
    date1 = new Date(date1[2], date1[1]-1, date1[0]);
    date2 = new Date(date2[2], date2[1]-1, date2[0]);
    var deals = JSON.parse(dealjson);
    var achieved = 0;

              while (date1 <= date2) {
                  var next_day = new Date(date1);
                  next_day.setDate(date1.getDate() + 1);
                  achieved = 0;
                  deals.forEach(function (deal) {
                      var dealDate = deal.dealdate;
                      dealDate = dealDate.split('-');
                      dealDate = new Date(dealDate[2], dealDate[1]-1, dealDate[0]);
                   
                      if(dealDate===date1)
                          console.log("matched"+date);
                      
                     
                  });
     
              date1 = next_day;
    }

});