Translation of day names - Forum

Forum Navigation
You need to log in to create posts and topics.

Translation of day names

Let me start by saying that I am just a beginner with VMW.

By doing some tests I would need to have the name of the day in Italian

If I use:

SetVar [DAY] [NAB.Day]
dtDayName [DAX]

In both cases the variables [DAY] [DAX] are always Thursday.
How can I get the day translated into Italian (Giovedì)?

I set the program and the language code to Italian, but nothing.
Is it possible that it automatically recognizes the language?

Thank you

@naglieri we need a bit of JavaScript. Try this:

BeginJS
  language = 'it-IT';
  currentDate = new Date();
  currentDayOfWeek = currentDate.getDay();
  date = new Date(0, 0, currentDayOfWeek);
  $App.dayName = new Intl.DateTimeFormat(language, { weekday: 'long' }).format(date);
EndJS

.Now [dayName] stores the italian name of current day
jsAlert "Oggi è: [dayName]"

I hope it helps.

Thank you very much.
Of course..... IT WORKS :-)