How to Change the Month Name English to Arabic

Viewed 210

In Below my codepen link i have event Calendar which fetch English month directly but i wanted change its month name to Arabic

For example : February needs to be changed to "فبراير"

Codepen Link : Click Here

$('.b-calendar__header .month').each(function() {
    var text = $(this).text();
    $(this).text(text.replace('February', 'فبراير')); 
});

I tried This way but not working

Please Help

1 Answers

I hope this is Usefull for you

const formatter = new Intl.DateTimeFormat('ar', { month: 'short' });
const month1 = formatter.format(new Date());
console.log(month1);

Related