Need to add 5 business days to a date field.

malaisamy1
Kilo Contributor

Hi Guys,

I have a scenario where i need to add 5 business days to a date field. while adding 5 days it has to exclude the Saturday and Sunday.

Note: This is a date field. not a date and time.

Is there any solution?.. Please help me on this.

Thanks in advance.

Malaisamy J

1 ACCEPTED SOLUTION

Hi Malaisamy,



Please replace the line var issueStartDate = current.issueStartDate.getGlideObject(); with below:


var issueStartDate = new GlideDateTime(current.issue_start);



Let me know, if this helps.



Regards,


Prajakta



PS - Please mark Helpful, Like, or Correct Answer if applicable.


View solution in original post

14 REPLIES 14

Deepak Kumar5
Kilo Sage

malaisamy1
Kilo Contributor

Sorry guys,



Actually my requirement is,



we have two field, One is issue start date and another one is RCA due date.



for some condition,



RCA due date is 7 Business days from "Issue Start".



is there any solution for this scenario?



Thanks in advance.



Malaisamy


This is what you need



http://wiki.servicenow.com/?title=GlideDateTime#addDays.28int.29




var gdt = new GlideDateTime("2011-08-31 08:00:00");


gdt.addDays(7);


gs.print(gdt.getDate());


-Anurag

Anurag,



while adding 7 days it has to exclude the Saturday and Sunday..



It has to add only business days.