Problems with date calculation

I have set up snippet 1.

Within snippet 1, I have imported a snippet (snippet 2) where all of the questions reside. The questions are housed within a {note} {endnote}. Not sure if this will make a difference.

Within snippet 1, I have multiple other snippets (just say snippet 3) where all of the text that will be reproduced resides.

I have inserted a date field in snippet 2

{formdate: MMM Do, YYYY; name=datex}

I have also set up a text field to insert the number of days I want to add to the date

{formtext: name=enddays; default=0; cols=6}

I just cannot figure out how to reproduce a date in snippet 3 that is datex + enddays.

I have used

{time: MMM Do, YYYY; shift=+{=enddays}D; at={=datex}}

But when I do this it says "Could not parse "Mar 7th, 2024" as a date or time. Considering using the "pattern" setting" . Do not understand what the prob is because dates are in the same format.

Any assistant will be greatly appreciated.

Hi @michael1,

You're on the right track with pattern. It is used to set format for date passed to at setting. The reason this is required here is because the format is different from the default one. You changed it by changing it on formdate - MMM Do, YYYY. So you just need to pass same format to pattern. Added an example below.

{formdate: MMM Do, YYYY; name=datex}
{formtext: name=enddays; default=0; cols=6}
{time: MMM Do, YYYY; shift=+{=enddays}D; at={=datex}; pattern=MMM Do, YYYY}