Skip to Content
avatar image
Former Member

Display current Date in odata model

6.png

trying to get current date /todays date using xml , but whenever trying to get date using json model odata stop displaying the data. so can anybody send me the code how to get current date in the odata model as shown in the image

6.png (1.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 13, 2017 at 05:17 PM

    Try following. Also in ODATA Model use String as suppose to date format.

    <DatePicker id="DP1" class="sapUiSmallMarginBottom" displayFormat="yyyy-MM-dd"

    value="{/todaydt}" />

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2017 at 09:40 AM

    not working..thank you

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 15, 2017 at 11:26 PM

    Hello Seema,

    Are you trying to bind odata model to a view?

    Could you please post your odata service xml or metadata here?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      thank you Tri Minh it is solved now....

      just need to add one line

      this.getView().byId("DP1").setValue(new Date());