cancel
Showing results for 
Search instead for 
Did you mean: 

is there any DateTime picker control in UI5

Former Member
0 Kudos

Is there any Date time picker control in UI5.I have got datepicker control but I am not able to associate time format with it.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sudipta,

Tufale Ashai is right, this question is not for this forum. Should be post to "UI Development Toolkit for HTML5 Developer Center".

With refer to your query, we can not directly control the DateTime through DatePicker API provably. For different DateFormat we have to use model and later need to bind that model into DatePicker.

In the above example you can use different pattern like "yy-MM-dd" , "yyyy-MM-dd", "dd/MM/yyyy", "yyyy/MM/dd" etc. But, if you use "dd/MM/yyyy HH:mm:ss" , you will get incorrect result.

Now, if your requirement is to get the DateTime format like "dd/MM/yyyy HH:mm:ss" into your application there is a another way to get that.

ManageDate.view.js :--

CreateDatePicker.js :--

ManageDate.controller.js :-

index.html :-

The above example is just to show a different way to get the result in that DateTime format. Hope this can help you.

Best Regards,

Bibhas Das

Former Member
0 Kudos

With refer to my above post, this is the example where the current time will update dynamically.   If your preference is not stick to DatePicker, you can use sap.m.DateTimeInput which already suggested by Christian. Here below I am giving an example by using DateTimeInput.

Best Regards,

Bibhas Das

Aisurya
Participant
0 Kudos

Hi,

I tried the way you mentioned .

But i have 2 views , when i set the Date picker value from View 1 and navigates to  View 2 , the value become blank.

Could you help me in this..

Thanks,

Aisurya

Former Member
0 Kudos

Hi Aisurya,

As you said there are two views, if that views are in the same page you can easily retrieve the value. Either by storing it in separate JS file variable or directly you can call the views controller custom function which will basically return your date picker value. Its my assumption. Better please provide some code snippet by which I can visualize the issue and give the proper solution.

Best Regards,

Bibhas Das

Answers (2)

Answers (2)

former_member185280
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Sudipta,

   I am not sure if this is the right forum to ask. Post your question here, . You will be answered.

Regards,

Tufale Ashai.