Different language on date

question if website is in english and I just want one section within that site to display the dates in another language is that possible?

e.g. english

but i want just that in diff lang e.g. arabic
I thought this might work but it does not

Any ideas?

modx 3.0.2
pho 8.1

you could create your own output filter using intlDateFormatter

many thanks for that will try

thanks for the tip @bruno17

in case anyone else got the same / similar question as me

use like this [[*publishedon:strtotime:dateMonthLang=`zh`]]
//snippet called dateMonthLang
$input = !empty($input) ? $input : '';
$options = !empty($options) ? $options : 'en';
$formatter = new IntlDateFormatter($options, NULL, NULL);
$output= $formatter->format($input); 
return $output;
1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.