Page 1 of 5

Changing the generated time

Posted: Sat Jul 05, 2014 8:15 am
by Lim Samantha

hi how can i change the time that is auto generated? Image


Changing the generated time

Posted: Sat Jul 05, 2014 1:27 pm
by Illya Stepanov

Hi Lim,

This is the generated time stamp from DB service, which way you want to change it?


Changing the generated time

Posted: Sat Jul 05, 2014 3:24 pm
by Lim Samantha

Maybe it can be in 12 hours without generating the seconds? like those weird decimals behind it.


Changing the generated time

Posted: Mon Jul 07, 2014 2:08 pm
by Evgene Karachevtsev

Hello Lim,

Appery.io DB always saves date time, you may not display the time, for example like this:
You can add this JS on the mapping of the label that displays the date:

codevar d = new Date(value),
minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),
hours = d.getHours().toString().length == 1 ? '0'+d.getHours() : d.getHours(),
ampm = d.getHours() >= 12 ? 'pm' : 'am',
months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
return days[d.getDay()]+' '+months[d.getMonth()]+' '+d.getDate()+' '+d.getFullYear()+' '+hours+':'+minutes+ampm;/code


Changing the generated time

Posted: Mon Jul 07, 2014 3:06 pm
by Lim Samantha

Hi, have tried your codes. But still doesn't work.
Mapping of the label as in just click on events and add in the code when i run JS right?
Image


Changing the generated time

Posted: Tue Jul 08, 2014 4:04 am
by Yurii Orishchuk

Hi Lim,

You need add this code to "Add JS" in your mapping where you link the date field to label.

See details: http://prntscr.com/40i215/direct

Also don't forget to delete this code from current place.

Regards.


Changing the generated time

Posted: Tue Jul 08, 2014 5:06 am
by Lim Samantha

Hi,
followed the steps, when i add in the code, the date works. However, the problem now is I am unable to send out messages


Changing the generated time

Posted: Tue Jul 08, 2014 5:46 am
by Kateryna Grynko

Hi Lim,

Do you mean PushNotifications? Could you please clarify what you tried and what doesn't work?


Changing the generated time

Posted: Tue Jul 08, 2014 7:46 am
by Lim Samantha

i Added in the codes in the JS, the time is able to display but I couldn't send out messages.


Changing the generated time

Posted: Tue Jul 08, 2014 2:14 pm
by Kateryna Grynko

Hi Lim,

If you want to add current date use:prevar d = new Date()/preInstead of:prevar d = new Date(value)/pre