Skip to Content
0

After Refresh Model.read date changed

Feb 13, 2017 at 03:54 AM

58

avatar image
Former Member

Hi,

Navigated page having a model.read function by which I am getting the date. And I am getting created_date : Fri Feb 10 2017 05:30:00 GMT+0530 (India Standard Time) in records. Please see the screenshot name beforeRefresh.jpg.
beforrefresh.jpg

And When I refresh the navigated Page (Same Page). Model.read function gives me the data create_date : "/Date(1486684800000)/" in records. Please see the screenshot name afterRefresh.jpg.

afterrefresh.jpg

Because of this the UI also getting the different dates before refresh and after refresh the page.

Please suggest why it is happening.

Thanks in Advance.
Somdutt Sharma

beforrefresh.jpg (118.4 kB)
afterrefresh.jpg (115.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Feb 13, 2017 at 05:58 AM
0

Hi Somdutt,

Both created Date have same meaning. i mean both are showing same date. you can archive this using formatter.

Thanks,

Rohit.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rohit,

Can you please share me an example to apply formatter on it. when the page is loaded first time. And after refresh when the json date format is coming in oModel.read data.

Thanks & Regards
Somdutt Sharma

0
Akhilesh Upadhyay Feb 13, 2017 at 11:30 AM
0

Hello,

As i think, first time data is getting pulled in xml format and further in json format.

yo can check the request URl for second time whether format=JSON filter is getting appended or not, and if JSON filter is there, you can try to avoid that and make identical request from UI or that may handled from backend/gateway itself.

Or,

you can handle both type of date and inside response, and in condition format date as per your requirement with the help of formatter function.

Thanks,

Akhielsh

Share
10 |10000 characters needed characters left characters exceeded