on 11-27-2008 7:46 AM
Hi,
I have UI element, for which value is directly mapped to the model attribute.(which is a date field)
Bapi is sending the date in the format of -- YYYYMMDD.
In the portal it is displayed as --- MM/DD/YYYY.
As per the requirement it has to be displayed as DD/MM/YYYY.
I think it is picking automatically by the systemdate format (not sure).
How can i display in DD/MM/YYYY format, even though bapi send us in YYYY/MM/DD format
Thanks
Maha
Hi Maha,
You can use the following code for setting the date format and the time zone as per your requirement:
//formatting the Date
TimeZone tz = TimeZone.getTimeZone("GMT+05:30");
SimpleDateFormat formatter =(SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.US);
formatter.setTimeZone(tz);
formatter.applyPattern("DD/MM/YYYY");
take your UI element name and set Formatter.format(Your UI).
Hope it helps.
Regards,
Gaurav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check the folllowing code
SimpleDateFormat fSDateFormat = new SimpleDateFormat ("dd/MM/yyyy");
Date now = new Date ();
wdcomponentAPI.getMessageMananger.reportSuccess(now.toString());
String date_out = fSDateFormat.format (now);
wdcomponentAPI.getMessageMananger.reportSuccess(date_out.toString());
Here i inserted the system date.
There you take of the date and keep the date which you are getting from BAPI.
Thanks & Regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a simple Type in Dictionary.In that in the representation tab metion the format which you want to display like yyyy/MM/dd etc.
Then map the type of the context attribute to this dictionary simple type.Then you will get the format you want
Regards
padma N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.