Display French date in email | Community
Skip to main content
Level 3
March 28, 2023
Solved

Display French date in email

  • March 28, 2023
  • 1 reply
  • 909 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DjTFox

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") %}

1 reply

DjTFoxAccepted solution
Level 2
March 29, 2023

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
March 29, 2023

Thank you! This worked.

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