選擇當前日期時,顯示消息爲You cannot select a day earlier than today
。java腳本比較日期;總是顯示消息,因爲當前日期是早期日期
function checkDate(sender, args) {
if (sender._selectedDate) < new Date()) {
alert("You cannot select a day earlier than today!");
sender._selectedDate = new Date();
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
}
}
比較工作不正常。
請幫幫我。
你有一個語法錯誤 – andrex 2014-09-23 11:39:08
是sender._selectedDate一個日期對象嗎? – 2014-09-23 11:39:14
'if(sender._selectedDate)
andrex
2014-09-23 11:39:39