Skip to Content
author's profile photo Former Member
Former Member

Setting date from OData response without conversion

Is there a way to set the date (Edm.DateTime) i get from odata read request. I mapped the odata to my datePicker as follows

value: {

path: "ActionsData>/HireDate",

type: new sap.ui.model.type.Date({

source: {

pattern: "timestamp"

},

pattern: "dd.MM.yyyy",

strictParsing: true

})

},

but unfortunatelly the date is displayed like: NaN.NaN.0NaN

Any ideas to how to display the date in format dd.MM.yyyy with minimal effort?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2015 at 01:48 PM

    Hi,

    I've set my datepicker's format using the following code, it might help you out a bit:

    var datePicker = new sap.m.DatePicker({
         valueFormat: "yyyyMMdd",
         value: "{dateValue}"
    });
    

    You can probably just change the valueFormat to contain the following string: "ddMMyyyy".

    Hope this is helpful.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.