To get the current hijri date in javascript, I use Intl.DateTimeFormat
To get the arabic display :
new Intl.DateTimeFormat('ar-TN-u-ca-islamic', {day: 'numeric', month: 'long',weekday: 'long',year : 'numeric'}).format(Date.now());
the expected output :
> "الثلاثاء، 15 جمادى الآخرة 1440"
or in french language :
new Intl.DateTimeFormat('fr-TN-u-ca-islamic', {day: 'numeric', month: 'long',weekday: 'long',year : 'numeric'}).format(Date.now());
the expected output :
> "mardi 15 joumada ath-thania 1440"