Hi,
Is there a way to change the Date Picker Default Date? What I would like to show as the default date is the current date plus 5 business days. Is this possible?
Thank you for your help.
Joe
Solved! Go to Solution.
Here's a formula that will calculate todays date + 5 business days.
With({ startDate:Today(),
daysToAdd: 5
},
DateAdd(startDate, daysToAdd) +
RoundDown(daysToAdd/5, 0)*2 +
Switch(Weekday(startDate, StartOfWeek.Monday),
5,If(Mod(daysToAdd, 5)>0,2,0),
4,If(Mod(daysToAdd, 5)>1,2,0),
3,If(Mod(daysToAdd, 5)>2,2,0),
2,If(Mod(daysToAdd, 5)>3,2,0),
1,If(Mod(daysToAdd, 5)>4,2,0)
)
)
I have a post that describes how this formula works.
Also, you might consider voting for my idea here to include a built-in function to calculate business days.
Set the default date property of the control to:
DateAdd(Today(),5,Days)
hope it helps !
DefaultDate:
Today() + 5
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Thank you very much for your help. 🙂 Your formula works great but I need to only count business days and not weekends. Is that possible?
Thank you very much for your help. 🙂 Your formula works great but I need to only count business days and not weekends. Is that possible?
Check this tutorial from Reza Dorani:
https://youtu.be/QVvhDe6puq0?t=31
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Check this tutorial from Reza Dorani:
https://youtu.be/QVvhDe6puq0?t=31
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Here's a formula that will calculate todays date + 5 business days.
With({ startDate:Today(),
daysToAdd: 5
},
DateAdd(startDate, daysToAdd) +
RoundDown(daysToAdd/5, 0)*2 +
Switch(Weekday(startDate, StartOfWeek.Monday),
5,If(Mod(daysToAdd, 5)>0,2,0),
4,If(Mod(daysToAdd, 5)>1,2,0),
3,If(Mod(daysToAdd, 5)>2,2,0),
2,If(Mod(daysToAdd, 5)>3,2,0),
1,If(Mod(daysToAdd, 5)>4,2,0)
)
)
I have a post that describes how this formula works.
Also, you might consider voting for my idea here to include a built-in function to calculate business days.
Thank you very much for your help. 🙂
Thank you so much for your help. Impressive code and works awesome! Thank you again!
User | Count |
---|---|
255 | |
106 | |
85 | |
51 | |
43 |