Can anyone help me to change Gregorian date to Persian in JavaScript? I want to use it in HTML and JavaScript.
function convertDate(stringArg) { const ETF = '۰۱۲۳۴۵۶۷۸۹'; const ans = g2j(...stringArg.split('/').map(elem => +elem)) .map(elem => String(elem) .split('') .map(subElem => ETF[+subElem]) .join('') ) .join('/'); return ans; }