|
|

楼主 |
发表于 2012/3/9 14:16:37
|
显示全部楼层
//值提示去掉虚线和参数名
<script language="javascript">
var form = getFormWarpRequest();
var dropDown = form._oLstChoices_updownlist;//_updownlist为值提示组件名
dropDown.remove(1);
dropDown.remove(0);
dropDown.removeAttribute("hasLabel");
</script>
//date prompt默认为当日
//昨日
<script>
function subtractDay ()
{
var dtToday = new Date();
var dtYesterday = new Date( dtToday - 86400000 );
var strYesterday = [dtYesterday.getUTCFullYear(), dtYesterday.getMonth()+1, dtYesterday.getDate()].join("-");
return strYesterday;
}
pickerControlPDate.setValue( subtractDay() );//PDate为date prompt组件名称(日期名称要与其一直)
</script>
//本周第一天
<script>
function showWeekFirstDay()
{
var Nowdate=new Date();
var WeekFirstDay=new Date(Nowdate-(Nowdate.getDay()-1)*86400000);
var strWeekFirstDay = [WeekFirstDay.getUTCFullYear(), WeekFirstDay.getMonth()+1, WeekFirstDay.getDate()].join("-");
return strWeekFirstDay;
}
pickerControlPDate.setValue( showWeekFirstDay() );
</script>
//本月第一天
<script>
function showMonthFirstDay()
{
var Nowdate=new Date();
var MonthFirstDay=new Date(Nowdate-(Nowdate.getDay()-1)*86400000);
var strMonthFirstDay = [MonthFirstDay.getUTCFullYear(), MonthFirstDay.getMonth()+1, MonthFirstDay.getDate()].join("-");
return strMonthFirstDay;
}
pickerControlPDate.setValue( showMonthFirstDay() );
</script>
//本月最后一天
<script>
function ShowMonthLastDay()
{
var Nowdate=new Date();
var MonthNextFirstDay=new Date(Nowdate.getYear(),Nowdate.getMonth()+1,1);
var MonthLastDay=new Date(MonthNextFirstDay-86400000);
var strMonthLastDay = [MonthLastDay.getUTCFullYear(), MonthLastDay.getMonth()+1, MonthLastDay.getDate()].join("-");
return strMonthLastDay;
}
pickerControlPDate.setValue( ShowMonthLastDay() );
</script> |
|