//------[获取两个日期中所有的月份中] function getMonthBetween(start,end){ var result = []; var s = start.split("-"); var e = end.split("-"); var min = new Date(); var max = new Date(); min.setFullYear(s[0],s[1]); max.setFullYear(e[0],e[1]); console
Date.prototype.format = function() { var s = ''; var mouth = (this.getMonth() + 1)>=10?(this.getMonth() + 1):('0'+(this.getMonth() + 1)); var day = this.getDate()>=10?this.getDate():('0'+this.getDate()); s += this.getFullYear() + '-'; // 获取年份. s +=
https://blog.csdn.net/m0_37852904/article/details/85790793 // 计算续住的总日期列表 getAll(begin, end) { let arr1= begin.split("/"); let arr2= end.split("/"); let arr1_= new Date(); let arrTime = []; arr1_.setUTCFullYear(arr1[0], arr1[1] - 1, arr
function getMonthBetween(startDate,endDate){ startDate=new Date(startDate.replace(/-/g,'/')); endDate=new Date(endDate.replace(/-/g,'/')); var num=0; var year=endDate.getFullYear()-startDate.getFullYear(); num+=year*12; var month=endDate.getMonth()-s
function getDate(datestr){ var temp = datestr.split("-"); var date = new Date(temp[0],temp[1],temp[2]); return date; } var start = "2016-10-10"; var end = "2016-10-18"; var startTime = getDate(start); var endTime = getDate(en