Skip to Content
0

How to display a Date in SAP UI5?

Jul 07, 2017 at 05:32 AM

85

avatar image
Former Member

Hi Techies,

I am new to SAP UI5.

When i am trying to display the date it was showing

I need to display only date .Please explain ASAP.

Thanks & Regards

Lokesh

ui5date.png (8.6 kB)
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Lokesh

First and foremost, can you tell us what do you have as raw data? I suppose you made a call the fetch the person date. What was return to you? Was it the string that is highlighted?

Thanks

-D

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member Jul 07, 2017 at 06:17 AM
0

Hi Lokesh,

Please use sap.m.DatePicker to show the date. if its used only to view details you can set enabled property to false.

regards

GB

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 07, 2017 at 06:27 AM
0

Hello Lokesh,

You could try this:

// you can replace whatever pattern - check LDML format

var dateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern :"YYYY/MM/DD"});

// replace yourDate here with your Date or binding value

var dateFormatted = dateFormat.format(yourDate);

Regards,

Tri

Share
10 |10000 characters needed characters left characters exceeded
Pavan Bhamidipati Jul 07, 2017 at 06:35 AM
0

Hi,

Please check Date type in the explored section of theSAPUI5 demokit

Thanks, Pavan

Share
10 |10000 characters needed characters left characters exceeded