Poster 2 {{date.format}}

I have a problem I’d like to resolve regarding the dates in “Poster 2.”
I’d like {{date.format}} to display the date like this:
domenica, 22 febbraio 2026
instead of:
22 febbraio 2026

Basically, I’d like the name of the day of the week to also be displayed.

dddd d mmmm yyyy

The names of the days of the week in Italian are: lunedì, martedì, mercoledì, giovedì, venerdì, sabato e domenica

It seems like this works, but I don’t know if it’s right:

<div style="text-align: right;">
<script>
(function() {
    var rawDate = "{{date.format}}"; 
    var parts = rawDate.split('-');
    
    if (parts.length === 3) {
        var d = new Date(parts[0], parts[1] - 1, parts[2]);
        var options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' };
        var formatted = d.toLocaleDateString('it-IT', options);
        
        // METODO SICURO PER LA VIRGOLA:
        // Divide la stringa allo spazio e aggiunge la virgola solo al primo pezzo
        var parole = formatted.split(' ');
        parole[0] = parole[0] + ','; 
        var finalDate = parole.join(' ');
        
        document.write(finalDate);
      } else {
        document.write(rawDate);
      }
})();
</script>
</div>

If it works, its correct.

1 Like