Page 1 of 1

Customize return _createdAt

Posted: Sat Aug 20, 2016 7:53 am
by Nicklas

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...


Customize return _createdAt

Posted: Sat Aug 20, 2016 8:15 am
by Serhii Kulibaba

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


Customize return _createdAt

Posted: Sat Aug 20, 2016 10:39 am
by Nicklas

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


Customize return _createdAt

Posted: Sun Aug 21, 2016 7:47 am
by Serhii Kulibaba

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