Friday 14 October 2011

Compare Dates

The following code will help you compare 2 dates in OAF.You should write this in your extended controller:

                 Date out_date = null;

                 rootAM =  pageContext.getRootApplicationModule();
                
                 ReqHVO =  (OAViewObject)rootAM.findViewObject("AuctionHeadersAllVO");
                
                 ReqRow = ReqHVO.first();
                                                                            
                 out_date = (Date)ReqRow.getAttribute("CloseBiddingDate");
                
                 OAApplicationModule am = pageContext.getApplicationModule(webBean);
                 SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
                 Date current_date = am.getOADBTransaction().getCurrentDBDate();
               
                if (out_date.getValue().getTime() > current_date.getValue().getTime()) {
}

No comments:

Post a Comment