if(this.contBizDate==null|| this.contBizDate.getParent()==null){
return;
}
Hashtable hs = new Hashtable();
DepUtil.findComponent(this.contBizDate.getParent(),new String[]{"pkkDDatePicker"},hs);
if (hs.size() > 0) {
Object oo = hs.get("pkkDDatePicker");
if (oo != null) {
shijiDate = (KDDatePicker)oo;
shijiDate.addDataChangeListener(new DataChangeListener(){
@Override
public void dataChanged(DataChangeEvent arg0) {
// TODO Auto-generated method stub
Object shijidateObj=shijiDate.getValue();
if(shijidateObj==null){
return;
}
Calendar curDate = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date dString=null;
dString= Date.getDate(shijidateObj);
curDate.setTime(dString); //实际业务日期
if(dString==null){
return;
}
String s=dString.toString().substring(8, 10);//截取日的部分
int day=Integer.parseInt(s);
if(day>25){
curDate.add(Calendar.MONTH, 1);//设置为下个月
curDate.set(Calendar.DAY_OF_MONTH,1);//设置为1号 ,下月第一天
// String newFirstDay = format.format(curDate.getTime());
pkBizDate.setValue(curDate.getTime());//设置业务日期
}else{
pkBizDate.setValue(curDate.getTime());//设置业务日期
}
}
});
}
}
推荐阅读