Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:56 AM - edited 09-18-2023 01:57 AM
Hi all,
I am trying to get "Updated" value via Data Resource in Repeater (UI Builder).
const dateItem = api.item.value.sys_updated_on.value;
I wonder how to add 14 days or 2 weeks in the script... any Idea?:)
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:35 AM
Hi @WNSN,
var dateItem = api.item.value.sys_updated_on.value;
var result = new Date(dateItem );
result.setDate(result.getDate() + 14);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:35 AM
Hi @WNSN,
var dateItem = api.item.value.sys_updated_on.value;
var result = new Date(dateItem );
result.setDate(result.getDate() + 14);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:41 AM
Hi @WNSN
Try below script :
const dateItem = api.item.value.sys_updated_on.value;
var futureDate = new GlideDateTime(dateItem);
futureDate.addDays(14);
Vishal Birajdar
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates