Skip to Content
avatar image
Former Member

How to display a Date in SAP UI5?

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)
Add comment
10|10000 characters needed 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

  • Get RSS Feed

3 Answers

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2017 at 06:27 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 07, 2017 at 06:35 AM

    Hi,

    Please check Date type in the explored section of theSAPUI5 demokit

    Thanks, Pavan

    Add comment
    10|10000 characters needed characters exceeded