We are trying to use the Date/Time math feature.
Is there a way to have it use business days and skip Sat/Sun, example if 60 days from today is a Sun, it would give the next business day of Monday 10/26/2025 and not Sunday 10/25/2025
We are trying to use the Date/Time math feature.
Is there a way to have it use business days and skip Sat/Sun, example if 60 days from today is a Sun, it would give the next business day of Monday 10/26/2025 and not Sunday 10/25/2025
Hey Stephanie, I’m checking with the support team on this. Thanks for your patience!
Hi Stephanie,
I was able to have AI write a javascript snippet for you that does this. I didn’t test it extensively, so you should test a bit before using. I used a fill-in to set the number of days you want to skip forward. I’ll include it below with instructions on how to set it up, but if you’d prefer an easier approach, you can DM me your email and I’ll share the snippet with you via TextExpander.
Create a new snippet, set the type to “javascript”, and enter the code below in the snippet body. Then go to the second line, and after the equals, but before the semi-colon, insert a single-line fill-in that lets you enter the number of days when you expand it.
let currentDate = new Date();
let remainingDays = ;
while (remainingDays > 0) {
currentDate.setDate(currentDate.getDate() + 1);
let dayOfWeek = currentDate.getDay();
// If it's a weekday (Monday-Friday), count it as a business day
if (dayOfWeek >= 1 && dayOfWeek <= 5) {
remainingDays--;
}
// If it's weekend (Saturday or Sunday), skip it and continue
}
currentDate.toDateString();
Thank you for sharing this. I quickly tested and it produced results I need to spend more time to make sure it’s the correct result.
The date is part of a larger block of text that I will need to figure out how to combine them. I quickly combined them together and it broke. I will spend more time later and let you know if we have questions. THANK YOU!
Got it. You could nest the snippet. A challenge here with javascript snippets is they pop up with a VERY messy fill-in window, that shows the script. If you nest that inside of another snippet it’s really a poor user experience.