cognos 将时间默认设置为当月的1号

拖动日期控件到页面
在工具箱里面拖动HTML项目到日期控件后面。在HTML写入:

<script>
var year=  new Date().getYear();
var month= new Date().getMonth()+1;
var day=new Date().getDate();
var time;
if(month>=10)
time=year +'-'+ month+'-'+01;
else
time=year +'-0'+ month+'-'+01;


//alert(time);
getFormWarpRequest().txtDateendDate.value=time;
</script>


日期控件里的时间即为当月1号。

猜你喜欢

转载自housheng33.iteye.com/blog/1847765