cancel
Showing results forĀ
Did you mean:Ā
See all
##### Top groups
Explore all groups

# CALCULATE A DATE WITH YEAR VARIABLE (NUMBER) DOESNT WORK

Mattis PASSARD February 9, 2024

Hello Everyone,

I need some help..

I explain :

When my customer signs a contract, like 31/01/2020 (DD/MM/YYYY).

The 31/01 became the birthday date.

So i need to set the birthday at 31/01/ {current year +1} = 31/01/2025 (to have a reminder)

To calculate the year to add at my signs contract to became my birthday date I do this :

`when custom field "SIGNS DATE" is set to a date, set custom field "ADD YEAR" to "{yearshort} - {{%SIGNS DATE}~YY} - 1"`

ADD YEAR = 24 - (20 - 1)

ADD YEAR = 24 - 19

(its works)

And i add 5 years to the date :

`when custom field "ADD YEAR" is set, set custom field "BIRTHDAY DATE" to "{%SIGNS DATE}+{%ADD YEAR}y"`

BIRTHDAY DATE = 31/01/2020 + 5 years

BIRTHDAY DATE = 31/01/2025

(not working)

The error :

Friday, February 9, 2024 10:46 AM

Running automation on board ...

The automation finished running.

I think i dont understand the arithmetic and formatting date doc :

https://support.atlassian.com/trello/docs/arithmetic-and-formatting-in-date-variables/

If anyone can help me on this š

Thanks you,

Mattis P.

#### 1 accepted

Dreamsuite Mike
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2024

I can tell you what to do to fix this automation:

`when custom field "ADD YEAR" is set, set custom field "BIRTHDAY DATE" to "{%SIGNS DATE}+{%ADD YEAR}y"`

`when custom field "ADD YEAR" is set, set custom field "BIRTHDAY DATE" to "{{%SIGNS DATE+{{%ADD YEAR}}y}}"`

There may be a much easier way though.

`when custom field "SIGNS DATE" is set, set custom field "BIRTHDAY DATE" to {{%SIGNS DATE={year}y}}`
Mattis PASSARD February 15, 2024

Hi Mike !

Thanks you a lot, your last automation works perfectly,

I do

`when custom field "SIGNS DATE" is set, set custom field "BIRTHDAY DATE" to {{%SIGNS DATE={year}y+1y}}`

To get the next year.

Thanks again !

Mattis P.

ā¢ Dreamsuite Mike likes this