cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying date in 01-Jan-2008 format

Former Member
0 Kudos

hi,

I have a urgent requirement while displaying date after selected from the date picker, Is it possible to display date in 01-Jan-2008 format in the date field.

Thanks in advance.

kris

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

closing the message.

regards,

Kris

Former Member
0 Kudos

Gopi,

It look like a bug in WebDynpro, Check below threads for more information:

http://help.sap.com/saphelp_nw04/helpdata/en/4a/05ad3e1d1edc61e10000000a114084/content.htm

Thanks

Sandy

Former Member
0 Kudos

Try this out...

<code>

Date date = new Date(System.currentTimeMillis());

String DATE_FORMAT = "dd-MMM-yyyy";

java.text.SimpleDateFormat sdf =

new java.text.SimpleDateFormat(DATE_FORMAT);

String actdate = sdf.format(date);

</code>

Former Member
0 Kudos

Hi,

Suppose there is a field cxt_date in the context of type Date. In order to set this date in the required format, u can use the folowing code :

SimpleDateFormat ob = new SimpleDateFormat("dd-MMM-yyyy");

String lfDate = "";

lfDate = ob.format(wdContext.currentContextElement.getCxt_date());

Regards,

Sayan Ghosh

.

Former Member
0 Kudos

Hi Gobi,

Create a simple type (Under Dictionaries), give Built in type as date. in representation tab give the format whichever you want

In your case, format is "dd-MMM-yyyy"

Assign this newly created simple type to your date value attribute.

Thanks

Sandy

Former Member
0 Kudos

Dear Sandeep,

Thanks for your suggestion. The format is now set to dd-MMM-yyyy foramt. But when we selected the date from date picker, it is not displaying in correct format.

For e.g., if we select 13 June 2008, then 13-066-2008 is getting displayed.

Please let us know if anything else needs to be set.

Regards,

Vaibhav

Former Member
0 Kudos

Hi,

1) Change the browser settings

2) Other one



IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Date"); //Your attribute
	  attributeInfo.getDataAttribute().getScalarType().format("dd-MMM-yyyy");

Regards

Ayyapparaj

Former Member
0 Kudos

hi,

Thanks for the quick response.

Let me try out this option and will get back to you,

one more thing what r the browser options to be changes that you have mentioned.

my requirement is on selecting the date picker field and selecting a particular date the date should be displayed as 01-Jan-2008, ie DD-MMM-YYYY format.

Thanks,

Kris

Former Member
0 Kudos

Hi,

am getting error in the 2nd approach at the line:

attributeInfo.getDataAttribute().getScalarType().format("dd-MMM-yyyy");

saying * getScalarType() method is undefine for the IWDAttributeInfo*.

Regards,

Deepak