# Add # of days (but do not count Sat/Sun)

**URL:** <https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437>\
**Category:** Have a question?\
**Tags:** dates\
**Created:** [August 27, 2025, 8:09pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437 "2025-08-27T20:09:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephanieStach](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@StephanieStach](https://community.textexpander.com/u/StephanieStach)\
**Post date:** [August 27, 2025, 8:09pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437/1 "2025-08-27T20:09:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![josh.centers](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/josh.centers/32/8_2.png) [@josh.centers](https://community.textexpander.com/u/josh.centers)\
**Post date:** [August 28, 2025, 6:38pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437/2 "2025-08-28T18:38:59Z")

</div>

Hey Stephanie, I’m checking with the support team on this. Thanks for your patience!

---

<div class="post-metadata">

**Author:** ![jd-mullin](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/jd-mullin/32/23_2.png) [@jd-mullin](https://community.textexpander.com/u/jd-mullin)\
**Post date:** [September 9, 2025, 11:17pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437/3 "2025-09-09T23:17:11Z")

</div>

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.

```javascript
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();

```

---

<div class="post-metadata">

**Author:** ![StephanieStach](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@StephanieStach](https://community.textexpander.com/u/StephanieStach)\
**Post date:** [September 16, 2025, 3:19pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437/4 "2025-09-16T15:19:54Z")

</div>

> [@jd-mullin](#):
>
> . 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.

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!

---

<div class="post-metadata">

**Author:** ![jd-mullin](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/jd-mullin/32/23_2.png) [@jd-mullin](https://community.textexpander.com/u/jd-mullin)\
**Post date:** [September 20, 2025, 3:07pm UTC](https://community.textexpander.com/t/add-of-days-but-do-not-count-sat-sun/437/5 "2025-09-20T15:07:26Z")

</div>

Got it. You could [nest the snippet](https://textexpander.com/learn/using/snippets/scripting-textexpander/nested-snippet-scripts). 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.
