cancel
Showing results for 
Search instead for 
Did you mean: 

Date Format

former_member187227
Participant
0 Kudos

Hi,

    when i print the date it show in different format. can you please give some idea. I attach the image check that,.

date.png

Accepted Solutions (0)

Answers (2)

Answers (2)

NagaPrakashT
Contributor
0 Kudos

Hi Vinoth,

As Maksim said you can use the formatter function here. Sample code below

formatter : function(oDate){

        if (!oDate) {

    return "";

        }

        jQuery.sap.require("sap.ca.ui.model.format.DateFormat");

        var oDateFormatter = sap.ca.ui.model.format.DateFormat.getDateInstance({style:"long"});

          return oDateFormatter.format(oDate);

    }}

Thanks,

Naga

former_member182372
Active Contributor
0 Kudos

broken image

former_member187227
Participant
0 Kudos
former_member182372
Active Contributor
0 Kudos

that is odata date format, how do you load the data? odatamodel should take care of it

special case scenario - formatter with something like

sap.ui.core.format.DateFormat.getDateInstance({

        style : "medium"

//or pattern : "yyyy/MM/dd hh:mm" or whatever you need

    }).format( eval('new ' + datestr.replace(/\//g, '')) )