Flow Designer Action to add number of days (integer) to a date

Shilpa Mannoni1
Tera Contributor

Can anyone help me with the script for an action where the number of days can be added to the date.

Input: Date, No of days

Output: Date

Script needs to: add Date + No of days and return date

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Shilpa Mannoni1 Here is the custom action for you which takes two parameters Date and number of days and add the days to date and returns the updated date.

 

Screenshot 2023-05-09 at 1.42.00 PM.pngScreenshot 2023-05-09 at 1.42.22 PM.pngScreenshot 2023-05-09 at 1.42.42 PM.pngScreenshot 2023-05-09 at 1.43.05 PM.pngScreenshot 2023-05-09 at 1.43.32 PM.pngScreenshot 2023-05-09 at 1.44.10 PM.png

Here is the script for run script.

(function execute(inputs, outputs) {
// ... code ...
  var someDate = new GlideDate();
  someDate.setValue(inputs.date);
  someDate.addDaysUTC(inputs.days);
  outputs.new_date = someDate;
})(inputs, outputs);

 

I am also attaching the update set which contains this Action.

 

Please mark this answer correct and helpful if it addresses your requirement.

 

View solution in original post

5 REPLIES 5

Lon Landry4
Mega Sage

Great stuff, thanks!