what is the api for service response? e.g. i want with moment js display date in particular format. i add custom js code to response - "moment().format('dddd');" but it doesn't work
what is the api for service response? e.g. i want with moment js display date in particular format. i add custom js code to response - "moment().format('dddd');" but it doesn't work
Where exactly did you add the JavaScript?
page - data - service - response - component (text field) (add js)
Test to make sure the script you are using works outside of mapping.. just by running it. Use the same data type/format that you get from the service.
Hi Max. It works fine. You can check this here: http://appery.io/app/mobile-frame?src...
Please click on 'Заполнить время из перем..."
It works standalone and in mapping or only in standalone example?
Max, only in standalone mode. In mapping it doesn't work
Hi Ilya,
For mapping you should use the following JS: prereturn moment(value).format("dddd, MMMM Do YYYY, h:mm:ss a");/pre
Then a processed value will be returned to a mapped element.
Katya, thank you.
This worked for me.
Could you please explain the logic of the JS you provided.
E.g. the service provided response, then to whom it is 'return'ed? To the page? And then what is 'value'? It's value of response of service? Why is it called 'value'?
What code did you have before?
This explains what is 'value': http://docs.appery.io/documentation/r...