Expand my Community achievements bar.

Adobe Journey Optimizer Community Lens 7th edition is out.
SOLVED

## Display French date in email

Level 3

I am trying to use this code:

``````{% let d = now %}
{% let frMonths = ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"] %}
{% let month=getMonth(d)%} {{frMonths}} {%= formatDate(d, "dd, YYYY") %}``````

To output the current date in French as below:

``mars 28, 2023``

But what I am getting back when I simulate content is:

``List(janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre) 28, 2023``

Does anyone know how I can achieve just the "mars" in the Month section?

1 Accepted Solution

Level 2

Hi, I have done something similar using an IF statement. Hope this could help

{% let d=now %}
{% let m=getMonth(d)%}
{% let frMonths=""%}
{%#if m=1 %}
{% let frMonths="janvier"%}
{% else if m=2 %}
{% let frMonths="février"%}
{% else if m=3 %}
{% let frMonths="mars"%}
{% else if m=4 %}
{% let frMonths="avril"%}
{%/if%}

{{frMonths}} {%= formatDate(d, "dd, YYYY") %}

3 Replies

Level 2

Hi, I have done something similar using an IF statement. Hope this could help

{% let d=now %}
{% let m=getMonth(d)%}
{% let frMonths=""%}
{%#if m=1 %}
{% let frMonths="janvier"%}
{% else if m=2 %}
{% let frMonths="février"%}
{% else if m=3 %}
{% let frMonths="mars"%}
{% else if m=4 %}
{% let frMonths="avril"%}
{%/if%}

{{frMonths}} {%= formatDate(d, "dd, YYYY") %}

Level 3

Thank you! This worked.

Do you have an online resource regarding the PQL language for use in AJO?

Level 4

Hi @DjTFox  can we have or condition in IF conditions