I want the date to be formatted in the following format:
date: 2016-12-04 at الأحد, 4 ديسمبر, 2016
But I get the following. Numbers are converted to Arabic numerals. I want the date and year to be in English:
الأحد, 4 ديسمبر, 2016
I used the following code to format the date in Arabic.
var date = new Date('2016-12-04'); options = { weekday: 'long', year: 'numeric', month: 'short', day: 'numeric', }; var dateString = date.toLocaleDateString('ar-SA', options); alert(dateString);
source share