Isaac
asked on
add days to Date
Hi All,
Has anybody ever used moment before? http://momentjs.com/
It seems like an easy way to manipulate dates.
I am trying to add days to a date I get from a sharePoint list but it's not working like I expect.
i think my syntax is wrong and I can't find anything on their site about how to do this.
The first alert shows the date being passed in but then the 2nd alert shows this..
"nxDte: Thursday at 11:17 AM".
It shows that for all the dates.
When I tried it this way
Any ideas or how I can add 6 days to any date?
Thanks!
Has anybody ever used moment before? http://momentjs.com/
It seems like an easy way to manipulate dates.
I am trying to add days to a date I get from a sharePoint list but it's not working like I expect.
i think my syntax is wrong and I can't find anything on their site about how to do this.
function getCumuVal(dte)
{
alert(dte);
var nextDate = moment().add('days', 6).calendar(dte);
alert("nxDte: "+nextDate);
}
The first alert shows the date being passed in but then the 2nd alert shows this..
"nxDte: Thursday at 11:17 AM".
It shows that for all the dates.
When I tried it this way
var nextDate = moment(dte).add('days', 6);
My alert produced the folllwoing: "1349841600000" but the values were different for each dateAny ideas or how I can add 6 days to any date?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!