我需要基於日期比較來創建JavaScript函數,這意味着要比較當天和當天+7。如何在JavaScript中進行Date Comparision?
function a(value)
{
//here how to get current date
//here how to add 7 days with current date
return addedvalue;
}
function b(value)
{
var s=a(value);
//again getting current date here
//check this function current date with s.then if its true means show,
alert('next 7th day is'+s);
}
如何做到這一點?
sevenDaysFromNow.setDate(now.getDate()+ 7);如果我把它放在這裏,它顯示1360098 – 2013-05-08 11:30:40
是新的腳本handling.Can你讓JSfiddle這個問題 – 2013-05-08 11:32:05
謝謝亞歷克斯.... – 2013-05-08 11:34:58