I want to calculate the number of days after the difference between 2 dates (Both dates in isoString format). When I try to subtract it returns NaN instead of the days. Here is my code, may I know where I went wrong?
my HTML
<ion-datetime displayFormat="DD-MM-YYYY" done-text="Select" min="2020" max="2021" placeholder="Forward Date" (ionChange)="selectDate($event)"></ion-datetime>
my .ts file
 selectDate(value){
    this.nextDate= new Date(+new Date() + 86400000+ 86400000).toISOString();  // date after 2 days from current date
    this.check=value.detail.value;
    console.log(this.check) // 2020-06-29T12:01:57.100+05:30 (This date is obtained from ion dateTime picker which is already in toISOString format)
    console.log(this.nextDate) // 2020-06-25T07:02:22.513Z
    this.ihe=this.check-this.nextDate; // Gives Nan
    console.log(Math.round(this.ihe/ (1000 * 3600 * 24)))
  }
Here nextDate is predefined date and check variable contains date selected from date picker.

 
     
    