这是我的代码,但是date显示出来是Nan-Nan-Nan请问该怎么办= =
function FormatDate (strTime) {
var date = new Date(strTime);
return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
}
function rightModify(qfgRightId){
$.ajax({
type: 'POST',
url: "${ctx}/designRequire/rightmodify",
data: {"qfgRightId":qfgRightId},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status+""+XMLHttpRequest.readyState+""+textStatus);
},
success: function(data){
var date=FormatDate(data.rightInfo.dtExpireDate);
alert(date);
if(data.ok == true){
$("#nmSqbId").val(data.rightInfo.nmSqbId);
$("#qfgRightId").val(data.rightInfo.qfgRightId);
$("#stRightNum").val(data.rightInfo.stRightNum);
$("#stIssueOrgan").val(data.rightInfo.stIssueOrgan);
$("#dtExpireDate").val(date);
$("#nmLandArea1").val(data.rightInfo.nmLandArea);
$("#black_bg").show();
$(".black_bg_table").show();
}else{
alert("数据出错!请稍后再试。");
}
}
});
}