How to make difference between two dates ionic3 using date-fns and momentjs

        


**         import { Component } from '@angular/core';**
**        import { NavController, DateTime,NavParams } from 'ionic-angular';**
**        import { IfStmt } from '@angular/compiler';**
**        import { DatePipe, DOCUMENT, getLocaleMonthNames } from '@angular/common';**
**        import { daysInMonth, parseDate } from 'ionic-angular/util/datetime-util';**
**        import { toBase64String } from '@angular/compiler/src/output/source_map';**
**        import { Console } from '@angular/core/src/console';**



**        @Component({**
**          selector: 'page-about',**
**          templateUrl: 'about.html'**
**        })**
**        export class AboutPage {**

**        datef;**
**        datett;**
**        dated1**
**        dated2;**
**        timeDiff;**

**        typeOfDateYear;**
**        typeOfDateMonth;**

**          constructor(public navCtrl: NavController) {**

**          }**

**        performFunction(type){**

**        var d1 = parseFloat(this.dated1);  **
**        var d2 = parseFloat(this.dated2);  **
**        var f = parseInt (this.datef);**
**        var tt = parseInt (this.datett);**


**        console.log(type);**

**        if(type =='a'){**


**        this.typeOfDateYear = tt - f **

**        this.typeOfDateMonth = this.typeOfDateYear / (24* 3600* 1000)**


**        }**
**        }**
**        }**
type or paste code here

What are you expecting ?