very strange issue I am seeing. I have attached 2 screenshots, one of which is on Android the other is on iOS. When I test my app on emulator, I get the correct number. When I test on Android, I get the correct number. But when it's on iOS, for some reason my Math.Ceil (in javascript) returns a NaN number on iOS. Here's my function currently:
var diffHours = Math.ceil((today.getTime() - creDate.getTime()) / (60 * 60 * 1000));
if (diffHours < 1) {
tmp[k].Difference = "Posted < 1 hours ago.";
} else {
tmp[k].Difference = "Posted " + diffHours + " hours ago.";
}
Where diffHours returns NaN on iOS only (So I know this is not a math issue, the number I get is correct just not on iOS).
Anyone have any idea why this could be?
If not, is there an alternative I can use to Math.Ceil that I can use that will give me same result?
UPDATE
Here are one examples of values that's being passed in
today = Fri Aug 28 2015 12:25:30 GMT-0500 (Central Daylight Time)
creDate = Thu Aug 27 2015 00:06:54 GMT-0500 (Central Daylight Time)
Attached Images (sorry the size is so big):
- Android
- iOS