# Add 90 days to a date that I enter (not current date)

**URL:** <https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532>\
**Category:** Have a question?\
**Tags:** dates\
**Created:** [January 27, 2026, 4:41pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532 "2026-01-27T16:41:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnnaJaeger](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AnnaJaeger](https://community.textexpander.com/u/AnnaJaeger)\
**Post date:** [January 27, 2026, 4:41pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/1 "2026-01-27T16:41:59Z")

</div>

I often need to print a date and calculate 90 days from that date.

For example:

”Your expiration date is December 15, 2025. Be sure to rejoin before March 15, 2026.”

I want to be prompted to enter the 12/15/25 date and have the snippet add 90 days to it. I am only finding example that show adding 90 days to the CURRENT date, not a date that the user enters.

---

<div class="post-metadata">

**Author:** ![TDK](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@TDK](https://community.textexpander.com/u/TDK)\
**Post date:** [January 27, 2026, 9:50pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/2 "2026-01-27T21:50:22Z")

</div>

If on a Mac, you could do this quite easily with Shortcuts. Run the shortcut, get prompted for date, enter, and then it will build your text string as per your example and pop it onto your clipboard for pasting.

 ![ScreenFloat Shot of Shortcuts on 2026-01-28 at 7-58-37 am](https://us1.discourse-cdn.com/textexpander/original/1X/886b870086f2b789e1dbac6e60ae0ae83e856c7d.png)

---

<div class="post-metadata">

**Author:** ![TDK](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@TDK](https://community.textexpander.com/u/TDK)\
**Post date:** [January 28, 2026, 7:53am UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/3 "2026-01-28T07:53:21Z")

</div>

Having thought about this a bit longer, with the new **date picker fill-in** , you can do this in Textexpander when combining the fill-in with JavaScript.

In the screen grab, you’ll see I’ve a JavaScript Content Type snippet with a date picker fill-in at the top, named **start\_date**. When setting this up, you’ll need to ensure you are using YYYY-MM-DD format. Then, you just paste in the script after it, as per the below…

```javascript
// Read the Date Picker fill-in value by its field name (“start_date")

var s = (TextExpander.filledValues && TextExpander.filledValues.start_date || "").trim();

// Expect YYYY-MM-DD (Important ! set this in the Date Picker settings)

var m = s.match(/^(\d{4})-(\d{2})-(\d{2})$/);

if (!m) {

'Couldn’t parse the date. Date Picker returned: "' + s + '"';

}

var startDate = new Date(parseInt(m[1],10), parseInt(m[2],10)-1, parseInt(m[3],10));

var endDate = new Date(startDate);

endDate.setDate(startDate.getDate() + 90);

function fmtUS(d) {

return d.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });

}

"Your expiration date is " + fmtUS(startDate) +

". Be sure to rejoin before " + fmtUS(endDate) + "."; 

```

So when expanding the snippet, your **start\_date** picker will appear. Select the date from the calendar, and then click on **Expand.** And that’s it. Your expiration sentence will expand with the appropriate dates.

 ![ScreenFloat Shot of TextExpander on 2026-01-28 at 7-40-10 am](https://us1.discourse-cdn.com/textexpander/original/1X/eca0b920594e7f9c3cb78c3f8dda6744dd1fb380.png)

---

<div class="post-metadata">

**Author:** ![AnnaJaeger](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AnnaJaeger](https://community.textexpander.com/u/AnnaJaeger)\
**Post date:** [January 30, 2026, 11:17pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/4 "2026-01-30T23:17:01Z")

</div>

> [@TDK](#):
>
> ```auto
> // Read the Date Picker fill-in value by its field name (“start_date")
> 
> var s = (TextExpander.filledValues && TextExpander.filledValues.start_date || "").trim();
> 
> // Expect YYYY-MM-DD (Important ! set this in the Date Picker settings)
> 
> var m = s.match(/^(\d{4})-(\d{2})-(\d{2})$/);
> 
> if (!m) {
> 
> 'Couldn’t parse the date. Date Picker returned: "' + s + '"';
> 
> }
> 
> var startDate = new Date(parseInt(m[1],10), parseInt(m[2],10)-1, parseInt(m[3],10));
> 
> var endDate = new Date(startDate);
> 
> endDate.setDate(startDate.getDate() + 90);
> 
> function fmtUS(d) {
> 
> return d.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
> 
> }
> 
> "Your expiration date is " + fmtUS(startDate) +
> 
> ". Be sure to rejoin before " + fmtUS(endDate) + "."; 
> 
> ```

Thank you for that. I’ve set it up as noted, but am getting an error when I expand it.

Here’s what I have for the setup:

 ![image](https://us1.discourse-cdn.com/textexpander/original/1X/54382c62fb7c22b42957a9ed2a54ff2a88f6c810.png)

---

<div class="post-metadata">

**Author:** ![AnnaJaeger](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AnnaJaeger](https://community.textexpander.com/u/AnnaJaeger)\
**Post date:** [January 30, 2026, 11:19pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/5 "2026-01-30T23:19:57Z")

</div>

When I run it, a window comes up with a date picker at the top and all the code below it. When I select my date and click expand, I get “JavaScript Error: TypeError - null is not an object (evaluating ‘m[1]’)”

---

<div class="post-metadata">

**Author:** ![TDK](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@TDK](https://community.textexpander.com/u/TDK)\
**Post date:** [January 31, 2026, 8:21am UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/6 "2026-01-31T08:21:36Z")

</div>

You’ve named the date picker variable **StartDate** and not **start\_date** as per the instructions. That’s why it’s failing as your JS is not seeing the variable. Best just start over, following the instructions as outlined.

---

<div class="post-metadata">

**Author:** ![SuzetteDollar](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/suzettedollar/32/353_2.png) [@SuzetteDollar](https://community.textexpander.com/u/SuzetteDollar)\
**Post date:** [May 20, 2026, 12:59pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/7 "2026-05-20T12:59:44Z")

</div>

Thank you very much for this. It works a treat! We need to do math based on start dates a lot. Now I’ve added JavaScript to the list of things I need to learn this year 🙂

---

<div class="post-metadata">

**Author:** ![TDK](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@TDK](https://community.textexpander.com/u/TDK)\
**Post date:** [May 20, 2026, 1:48pm UTC](https://community.textexpander.com/t/add-90-days-to-a-date-that-i-enter-not-current-date/532/8 "2026-05-20T13:48:42Z")

</div>

Glad to hear someone got it working.😉
