//
(1)计算发行天数 计算公式 : 到期日 - 发行日
// *参数说明:发行日:strIssueDate 到期日: strMaturityDate //*返回值 :发行天数: strIssueDays
function CountIssueDays()
... { var retValue = 0; if(strIssueDate.value!="" && strMaturityDate.value!="")
...{
var aDate,TrIssueDate,TrMaturityDate
//将日期分割成数组
var intIssueDatePlace = strIssueDate.value.indexOf("-") //检查日期中是否含有 - 号
if(intIssueDatePlace==-1)
...{
aDate = [strIssueDate.value.substring(0,4),strIssueDate.value.substring(4,6),strIssueDate.value.substring(6,8)]
}
else
...{
aDate = strIssueDate.value.split("-")
}
//将日期转换为mm-dd-yyyy
TrIssueDate = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
var intMaturityDatePlace = strMaturityDate.value.indexOf("-")
if(intMaturityDatePlace==-1)
...{
aDate = [strMaturityDate.value.substring(0,4),strMaturityDate.value.substring(4,6),strMaturityDate.value.substring(6,8)]
}
else
...{ aDate = strMaturityDate.value.split("-") }
//将日期转换为mm-dd-yyyy
TrMaturityDate = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
retValue = parseInt(Math.abs(TrMaturityDate - TrIssueDate) / 1000 / 60 / 60 /24) //把相差的毫秒数转换为天数
}
return retValue;
}
// *参数说明:发行日:strIssueDate 到期日: strMaturityDate //*返回值 :发行天数: strIssueDays
function CountIssueDays()
... { var retValue = 0; if(strIssueDate.value!="" && strMaturityDate.value!="")
...{
var aDate,TrIssueDate,TrMaturityDate
//将日期分割成数组
var intIssueDatePlace = strIssueDate.value.indexOf("-") //检查日期中是否含有 - 号
if(intIssueDatePlace==-1)
...{
aDate = [strIssueDate.value.substring(0,4),strIssueDate.value.substring(4,6),strIssueDate.value.substring(6,8)]
}
else
...{
aDate = strIssueDate.value.split("-")
}
//将日期转换为mm-dd-yyyy
TrIssueDate = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
var intMaturityDatePlace = strMaturityDate.value.indexOf("-")
if(intMaturityDatePlace==-1)
...{
aDate = [strMaturityDate.value.substring(0,4),strMaturityDate.value.substring(4,6),strMaturityDate.value.substring(6,8)]
}
else
...{ aDate = strMaturityDate.value.split("-") }
//将日期转换为mm-dd-yyyy
TrMaturityDate = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
retValue = parseInt(Math.abs(TrMaturityDate - TrIssueDate) / 1000 / 60 / 60 /24) //把相差的毫秒数转换为天数
}
return retValue;
}