2015-03-02 208 views
1

如何找到兩個日期之間的月份差異計數使用JavaScript或jQuery的月份的最後日期。兩個日期之間的月份差異計算lastdate月

例如:

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

01/03/2015 - 30/03/2015 - Month: 0 
+0

的可能重複http://stackoverflow.com/questions/2536379/difference-in-幾個月之間的日期在JavaScript中 – MrYoshiji 2015-03-02 15:44:26

+0

這不應該使用ruby-on-rails – 2015-03-02 15:54:42

+0

標記任何答案?? – 2015-03-03 11:26:57

回答

0

使用JavaScript Date:getMonth()方法:

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

更多信息here

相關問題