Page 1 of 1

Get Time when button is clicked

Posted: Thu Apr 03, 2014 4:42 am
by David Lim

I am doing one of a function in the app where user click the button , it record the current time and upload to database. But i unable to do it
Is there a appery code for this?


Get Time when button is clicked

Posted: Thu Apr 03, 2014 5:14 am
by Illya Stepanov

Hi David -

At first you have to create the update service for your collection.

At second need to invoke this service on button click event.

After you need to:
ol
liGo to data tab. And click "Edit mappings" for data source you have created with update service./li

liGo to request tab find your date field. Click "Add JS" in this field./li

liJS Editor appears. Insert the following code:
precode
var currentDate = new Date();

var currentTime = (/(\d\d\:\d\d).\d\d\dZ$/gi).exec(currentDate.toISOString())[1];

return currentTime;
/code/pre/li
That's all.

Regards./ol