Anil's Blog is Best Viewed on GOOGLE CHROME

Wednesday, April 8, 2009

Convert dateToString | stringToDate

Controller Code:-

Date date = (Date)oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("StartDate");
Date edate = (Date)oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("EndDate");


if (date != null && edate != null)
                       {
                        String Xs11 = oapagecontext.getOANLSServices().dateToString(date);
                        String Xs12 = oapagecontext.getOANLSServices().dateToString(edate);
}

In the same way we can convert String to Date
oapagecontext.getOANLSServices().stringToDate("xxxx");

2 comments:

  1. Replies
    1. Hi Anil,

      If I wish to perform the same date conversion in my AM code, how do I get a handle to the oapagecontext?

      From my CO I am calling,
      am.invokeMethod("MyMethodName",serializedparams);

      However I am not able to serialize and send the pageContext param also. Any help is appreciate.

      Delete

Note: Only a member of this blog may post a comment.