cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a Time picker like Date picker in web-dynpro

konchada_saikrishna
Active Participant
0 Kudos

Hi SDN,

When I bind a Input field to the date data type there accompanies a date picker,

Is there a time picker similar to the date one,

If there is no such time picker, can u suggest me how to display current system time in HH:MM:AM/pm or in 24 hour format. but in time data type but not as hours":"minutes":"sec (which is going to be a string data type)

Thanks in advance,

Regards,

Sai krishna.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

As far as I know there is no such time picker.

Regarding your second question:

1. Create a simple type, say timeStamp in the local dictionary. Switch to the representation tab and in the Format field enter "HH:mm:ss". Save.

2. Create a context value attribute say, CurrTime and change its type to the newly created simple type, timeStamp.

3. In wdDoInit, or whereever you want to set the value, use this code:

long millis = System.currentTimeMillis();
    	
Date currDate = new Date(millis);
    	
Time currTime = new Time(currDate.getTime());
    	
wdContext.currentContextElement().setTimeStamp(currTime);

4. Insert an inputfield into the view and bind the value property to the context attribute.

Regards,

Satyajit.

konchada_saikrishna
Active Participant
0 Kudos

Hi satyajit,

Thank you.

I have done that already. What about if I want to display time in am/pm or 24 hour format. and switching between these two formats is to be dynamic.

Regards,

Sai Krishna

roberto_tagliento
Active Contributor
0 Kudos

You can use WDVisibility attribute of your UIElement, when the user check am/pm or 24 hour format, you display one or other UIElement.

Isn´t un-necessary dynamic programming.

former_member182294
Active Contributor
0 Kudos

Hi Sai,

How user will switch between am/pm or 24 hour format? If its Radio buttons or Drop Down then any ways some action will be generated. So you can either use single input field with two attributes and switching binding attribute dynamically on event or you can use two input fields with Visibility property.

Regards

Abhilash