FormCalc Add five (5) business days to date

Avatar

Avatar
Level 1
coreywallen
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
coreywallen
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
coreywallen
Level 1

21-04-2016

Hey everyone, need some quick help adding business days to the date of another field. I currently only have a simple formula for adding five days to the the other field. Here is what I have. I need Field 2 to calculate 5 business days into the future based off of Field 1. Appreciate the help in advance. I've done a lot of searching around and just can't wrap my head around anything that is said to work.

Field 1: "DateFormCompleted" (User Entered)

Field 2: "RequestedCompletionDate" (Calculated - User Can Override)

Current FormCalc for "RequestedCompletionDate":

Num2Date((Date2Num(DateFormCompleted.formattedValue) + 5))

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile
tarekahf
Level 5

25-04-2016

Mind you that FormCalc is not supported on HTML5 forms. You have to convert to JavaScript.

Tarek

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

21-04-2016

Hi there,

a good way to do this, you would need to use the modulus (JavaScript : %, FormCalc : Mod(n1, n2)) to know exactly which day of the week the first date is,

you'll need to do some tests to see which day of the week represents which number... (I think 0 is sunday)

let's say you get a wednesday, you'll know you will need to do +7(weekend) considering +5 business days

Also if you're going in deep, if you have to consider the public holidays, you will have to register the days and then know exactly what is the modulus of that day on 365 for a normal year and 366 for a leap year

I hope this will help you to accomplish what you need...

If you have any other question, feel free to ask