Shift a date from a form input

Hey all,
I'm trying to set up a form where you can select a date and get an output 2 weeks days from the selected date.

This is what I have currently:

{formdate: YYYY-MM-DD; name=date}
{time:YYYY-MM-DD; at=date; pattern=YYYY-MM-DD ; shift=+2W}

And I'm getting the error:

Could not parse "date" as a date or time with the pattern "YYYY-MM-DD".


Hi, and welcome to the forum! :slight_smile:

Instead of at=date, you need at={=date}.

{formdate: YYYY-MM-DD; name=date}
{time:YYYY-MM-DD; at={=date}; pattern=YYYY-MM-DD ; shift=+2W}

Ahhh incredible. Thanks much!

Quick note, the shift setting can take multiple parameters.

{formdate: YYYY-MM-DD; name=date}
{time:YYYY-MM-DD; at={=date}; pattern=YYYY-MM-DD ; shift=+2W-2D+3M}

Additionally, you could use a variable in it too. For instance:

{formdate: YYYY-MM-DD; name=date}
Day modifier: {formtext: name=days; default=0}
Week modifier: {formtext: name=weeks; default=0}
Month modifier: {formtext: name=months; default=0}
Year modifier: {formtext: name=years; default=0}
{time:YYYY-MM-DD; at={=date}; pattern=YYYY-MM-DD ; shift={=days}D{=weeks}W{=months}M{=years}Y}

Is it possible to select the date as above, but have the shifted date presented in another formdate field instead?

Hi, and welcome to the forum! :slight_smile:

If I understand your question, you want two {formdate}'s one set to seven days after the other.

If so, that's not really possible as you have to be able to set the values of each of the {formate}'s, but your 7 day constraint links them together making that impossible.

Instead, I would suggest using one {formdate} and then using the {time} command to display the shifted date in the second spot.

Here is an example:

The book is due: {formdate: LL; name=due}

We'll charge you for it 7 days later: {time: LL; at={=due}; shift=7D}