我需要檢查的日期比當前日期增量更大兩天計數和顯示檢查日期大於2天,從今天的日期的JavaScript
JS代碼:
> var exceeds = 0; > var date = "25-02-2015"; > var today = new Date(); > if((new Date(today.getFullYear(), today.getMonth(), today.getDate()+2))>date) { exceed+=1; } > > console.log(exceeds);