function fixPersianCalendarDays() { document.querySelectorAll('.pwt-date-picker th').forEach(function (th) { const currentDays = ['ش', 'ی', 'د', 'س', 'چ', 'پ', 'ج']; const correctedDays = ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش']; let text = th.innerText.trim(); text = text.replace(/ي/g, 'ی'); // تبدیل "ي" عربی به "ی" فارسی const idx = currentDays.indexOf(text); if (idx !== -1) { th.innerText = correctedDays[idx]; } }); } // وقتی یه تقویم باز شد، اصلاح رو اجرا کن document.addEventListener('click', function (e) { if (e.target.classList.contains('hasDatepicker')) { setTimeout(fixPersianCalendarDays, 300); } }); // وقتی پاپ‌آپ لود شد apex.jQuery(document).on("apexafterrefresh", function() { setTimeout(fixPersianCalendarDays, 300); });