cancel
Showing results for 
Search instead for 
Did you mean: 

Date picker format

Former Member
0 Kudos

Hi,

I have a Date Picker in my view and its default date format is mm/dd/yyyy. I want to change its format to dd/mm/yyyy. Any way to change its format?

Rewards waiting for the right ans.

vinod.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

1)Create a simpletype of type date and there go to the representation tab and u can give

the format=dd/MM/yyyy

2)Then create a context attr of type as simple type and attch this to the value property of the inputfield

Regards

Hazrath

Former Member
0 Kudos

Hi Hazrath,

I found only one way; Thats just change the default language to English UK . I have tried all the way that you put forward and they were not in use.

Thanks for the reply.

Vinod V

Former Member
0 Kudos

Hi vinod,

I have tried with tis and i have succeed.

Try it must work.

1)Create a simpletype of type date and there go to the representation tab and u can give

the format=dd/MM/yyyy

2)Then create a context attr of type as simple type and attch this to the value property of the inputfield

Regards

Hazrath

liam_wilkinson
Participant
0 Kudos

Hi Vinod,

congratulations on finding a solution to your problem...did you change the default language in SU01? like I answered you.

If not can you share with us how you managed to do this.

Liam

Former Member
0 Kudos

Hi Liam,

Think an application where no RFC is used and have a problem of Date format. In this case your way can not be used; But i got the solution by changing the default language to English UK (en-gb);

Thanks for the reply and your time.

Vinod V

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

goto controlpanel ->regional and language settings

chage language to English UK.

log off n login again ill change date formatto dd/mm/yyyy

Thanks,

Sunitha Hari.

Former Member
0 Kudos

Hi,

Make use of the following code


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

Regards

Ayyapparaj

Former Member
0 Kudos

I coded that in the wdInit() but saying getScalarType() is not available in IWDAttributeInfo.

where may i went wrong?

liam_wilkinson
Participant
0 Kudos

Hi Vinod,

I had something similar and to get round it all what was needed was a change in SU01.

Test it for you

SU01 -> Person ->Format country = GB

communication -> Language = English

then refresh you web dynpro

hope it helps

Liam

Former Member
0 Kudos

Hi Liam,

In this work, i am not at all using any RFC; Its just a InputField UI element with its type as date. Now all i want is to change is default date format from MM/dd/yyyy to dd/MM/yyyy. I am able to change its format using SimpleDateFormat() for the first time; But once you select another date from the Date picker, the format again comes back as MM/dd/yyyy.

I need a solution for this.

Thanks,

- Vinod.

Former Member
0 Kudos

Hi,

Use the following:

SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy ");

String dateReturn = dateFormat.format(<Your Date>) ;

Hope this helps.

thanks & regards,

Hazrath.G

Former Member
0 Kudos

hello,

I think you didn't get the Qst.

The Date Picker is an Input field of type Date and by using the code its possible to chage the value only once. Once you select a date from the date picker, it again goes to the default date format; that is mm/dd/yyyy

Please go through the Qst..