Reputation: 65920
I have a list of object array as shown below.I need to apply moment.tz("2013-11-18 11:55", "America/Toronto");
to the all the LastUpdate
properties and retrieve the updated new array.So how can I do that ?.I can use underscore.js.Thanks in advance.
Upvotes: 0
Views: 41
Reputation: 245449
Any reason a simple loop won't work?
for(var i = 0; i < Progress.length; i++) {
Progress[i].LastUpdate = moment.tz(Progress[i].LastUpdate, 'America/Toronto');
}
OR
Progress.forEach(function (x) {
x.LastUpdate= moment.tz(x.LastUpdate, 'America/Toronto');
});
Upvotes: 1