Date reflecting "NAN-NAN-NAN"
Hi,
I tried fetching CREATED Date from the collection along with other columns.
All my mapping and data which is coming in is fine and works perfect.
For CREATED DATE, I am adding +8 hrs to the date and it gives me and my time is also correct(checked in console.log).
My Problem is:
This works fine with Appery Simulator on web browser and Android device but when I run it on iOS, it flashes "NAN-NAN-NAN".
The code is below:
codevar myDbDate = value;
var myDate = new Date(myDbDate); // date object
myDate.setHours(myDate.getHours() + 8); // 8 because my time is +8 UTC
var date = myDate.getDate();
var month = myDate.getMonth();
month = +month + 1;
var year = myDate.getFullYear();
var todayDate = date+"-"+month+"-"+year;
return todayDate;