Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
hey!
First run at ACC here, and trying to convert the current date into French months:
<%= formatDate(new Date(), "%D %Bi %Y") %>,
So instead of 20 July 2020, i would it to say 20 juillet 2020
Vistas
Respuestas
Total de me gusta
Hello @connorSlack24 ,
You can use moment.js in your workflow to achieve this.
Just download the moment.js library (from here). Then upload it in Administration > Configuration > JavaScript Codes
Then in your workflow you can use this code.
loadLibrary('NAMESPACE:moment.js');
var myDate=formatDate(new Date(), "%D %Bi %Y");
var frenchDate=moment(myDate, 'DDD MMMM YYYY', 'fr');More Information on date formatting is available here: https://momentjs.com/docs/#:~:text=moment(%2212%2D25%2D,valid%20dates%20over%20invalid%20ones.
Let me know if that works.
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
Hey Jonathon, Thanks!
Hey! My problem is the correct syntax, as i am new to eJS (coming from Freemarker) i cant seem to get it right:
<%= formatDate(toLocaleDateString('fr-CA), "%D %Bl, %Y") %>
Doesnt seem to work, but chances are im not coding it correctly.
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
Use the below, remove any js libs installed for this:
<%=
new Date().toLocaleDateString('fr-CA', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
%>Thanks,
-Jon
Vistas
Respuestas
Total de me gusta
Hey Jon,
I added that script to my personalization block, and called that into my delivery, and i am getting this error:
Error while evaluating document
JST-310000 Error while compiling script 'content htmlContent' line 20: missing ) after argument list (line=' }); ' token='; ').
SCR-160032 Javascript: error while compiling script 'content htmlContent'.
JST-310007 Unable to compile script (content htmlContent).
Vistas
Respuestas
Total de me gusta
@connorSlack24 Did this error get resolved?
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
@_Manoj_Kumar_ @Jonathon_wodnicki Can any of you further help with @connorSlack24 's query?
Thanks!
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas