I want to take Date.now and add 1 hour. This is my script:
var now2 = Date();
now2.setHours(now.getHours() + 1);
Xrm.Page.getAttribute("new_todaysdate").setValue(now2);
When it executes, page says there is no function for getHours. HUH? I thought that's supported JS.
So then i tried this:
// From: stackoverflow.com/.../how-to-add-30-minutes-to-a-javascript-date-object
var now = Date.now();
var now2 = new Date(now.getTime() + 60 * 60000);
Xrm.Page.getAttribute("new_todaysdate").setValue(now2);
Same type of error. Says getTime is not a function. Again, this says it is: http://www.w3schools.com/jsref/jsref_gettime.asp
What am i doing wrong?
Thank you