- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 05:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 07:59 AM
Hello srnewbie,
You beat me to it!
Here is my code, yours look way cleaner. Thank you for sharing your solution.
function onLoad() {
var today = new Date();
var inThreeDays = new Date();
inThreeDays.setDate(today.getDate() + 3);
var inThreeDaysFormatted = inThreeDays.getFullYear() + '-' + ('0' + (inThreeDays.getMonth() + 1)).slice(-2) + '-' + ('0' + (inThreeDays.getDate() + 1)).slice(-2);
console.log(inThreeDaysFormatted);
g_form.setValue('due_date',inThreeDaysFormatted );
}
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 07:13 AM
Hello srnewbie,
No need for GlideAjax in this one. You can make use of the native javascript Date class,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
I'll post example code later today.
Thannks