David Lim
Posts: 0
Joined: Wed Mar 12, 2014 3:58 am

Get Time when button is clicked

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?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Get Time when button is clicked

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

Return to “Issues”