Skip to Content
0

Display current Date in odata model

Oct 13, 2017 at 12:57 PM

84

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

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

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

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

value="{/todaydt}" />

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 14, 2017 at 09:40 AM
0

not working..thank you

Share
10 |10000 characters needed characters left characters exceeded
Tri Minh Le Oct 15, 2017 at 11:26 PM
0

Hello Seema,

Are you trying to bind odata model to a view?

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

Show 1 Share
10 |10000 characters needed characters left 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());

0