Reputation: 3452
I have this
$.each(data, function (id, item) {
var tempDate = new Date();
var tempTime = item.Time;
debugger;
tempDate =new Date(parseInt(item.Date.replace("/Date(", "").replace(")/", ""), 10));
self.items.push({ Name: item.Name, Date: (tempDate.getMonth() + 1) + '/' + tempDate .getDate() + '/' + tempDate.getFullYear(), Time: tempTime });
});
The main proble how to get time from tempTime it has type Object and function getHours do not work.
Upvotes: 1
Views: 51
Reputation: 7188
If you just want to get the hours from tempTime
, all you have to do is access the value of the Hours
property, like so:
tempTime.Hours // => 11
Upvotes: 1