Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 06:23 AM
Hi Team,
I have taken the below script from the thread but it's not giving desired results
client script to add 1 year to current date - Now Platform - Question - ServiceNow Community
var todayDate = new Date(new Date().setFullYear(new Date().getFullYear() + 1));
g_form.setValue('valid_to', todayDate.toISOString().slice(0,10));
It is adding the dates as
But it should be like below
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 07:29 AM
Hi,
image is broken
Script should work fine.
I just tried with the debugger.
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2024 09:26 AM
Wow...I wasnt sure what that was going to spit out but that worked exactly as intended. Thank you!