How to get no of months between the given dates using jquery
I have two date text-box fields one field is for start date and another field is for end date now if i give the below inputs which is not working with my below code how can i get it
var $startdate= new Date('09/01/2019')
var $enddate = new Date('10/02/2019')
var $months = $enddate.getMonth() - $startdate.getMonth() + (12 * ($enddate.getFullYear() - $startdate.getFullYear()));
Below is my expected output
Start Date(mm/dd/yyyy) End Date(mm/dd/yyyy) (Expected)Output (Present)output
08/28/2019 09/02/2019 2 1
06/01/2019 09/02/2019 4 3