Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

Customize return _createdAt

Hello! Im trying to find out how to make the return from database of _createdAt smaller.
Right now i got: for example: 2016-08-19 17:47:10.693
But what i really want is for example: 19-08-16 17:47

Can anyone help me?

Is it one of the param here? https://docs.appery.io/reference#serv...

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Customize return _createdAt

Hello Nicklas,

It is impossible to format these value ofn the database side, but you are able to change it's response with JS. E.g. use a momentJS format method in the loop of database service's response

Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

Customize return _createdAt

Thank you for the answere!
Could you give me a JS example?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Customize return _createdAt

Sure, please look at the example below:
prevar newFormat = moment(value).format("DD-MM-YY hh:mm");/pre

Return to “Issues”