标签:
congos 添加html的标签,然后写上js的代码,这段代码的功能是得到前一天的日期。
<input type="button" value="查询" onclick="init()" />
<script type="text/javascript">
function init()
{
promptButtonFinish();//调用触发值提示方法。Finish
}
function subtractDay()
{
var dtToday = new Date();
var dtYesterday = new Date( dtToday - 86400000 );
var strYesterday = [dtYesterday.getUTCFullYear(), dtYesterday.getMonth()+1, dtYesterday.getDate()].join("-");
return strYesterday;
}
function goto()
{
pickerControlPDate.setValue(subtractDay());//PDate为date prompt组件名称
promptButtonFinish();
}
</script>
<body onload=goto()>
标签:
原文地址:http://www.cnblogs.com/galeno/p/4761119.html