1

how to find the month difference between two dates counting last date of month using javascript or jQuery.

ex:

01/03/2015 - 31/03/2015 - Month: 1

01/03/2015 - 30/03/2015 - Month: 0
Mani David
  • 1,296
  • 1
  • 13
  • 28

1 Answers1

0

Use javascript Date:getMonth() method:

Date startDate = "01/03/2015";
var startMonth = startDate.getMonth(); 

Further info here

Jordi Castilla
  • 25,851
  • 7
  • 65
  • 105