mcdhappy80
Registered User.
- Local time
- Today, 20:43
- Joined
- Jun 22, 2009
- Messages
- 347
I need to create a function that will calculate which is the End Date and the arguments that will be provided are Start Date and Working Days. Now, I know that end date should be easily calculated when You add Days to Start Date but the problem here is that the user will provide Work Days which are 5 in week (excluding holidays) instead of 7 days of the week. Does anyone have idea how to do this? I was thinking of something like this to solve it:
The user provides WorkDays. I divide that value with 5, then for each value that lefts I add two days. Something like this:
WorkDays = 35; 35/5 = 7; DaysToAdd = 7 * 2 = 14; TotalDays = WorkDays+DaysToAdd (49), and the add that value to StartDate to get an EndDate.
What do You think?
The user provides WorkDays. I divide that value with 5, then for each value that lefts I add two days. Something like this:
WorkDays = 35; 35/5 = 7; DaysToAdd = 7 * 2 = 14; TotalDays = WorkDays+DaysToAdd (49), and the add that value to StartDate to get an EndDate.
What do You think?