Hi Lim,
This is the generated time stamp from DB service, which way you want to change it?
Maybe it can be in 12 hours without generating the seconds? like those weird decimals behind it.
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
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.
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
Hi Lim,
Do you mean PushNotifications? Could you please clarify what you tried and what doesn't work?
i Added in the codes in the JS, the time is able to display but I couldn't send out messages.
Hi Lim,
If you want to add current date use:prevar d = new Date()/preInstead of:prevar d = new Date(value)/pre