Rol Ian نشر 25 يونيو أرسل تقرير نشر 25 يونيو (معدل) كيف يمكن أن أقوم بتصميم تقويم يشمل التاريخ الهجري والميلادي في موقع Lovable.dev وتكون الأوقات صحيحة لأنه يظهر التاريخ الهجري خاطئ غير متوافق مع الميلادي تم التعديل في 25 يونيو بواسطة Rol Ian 1 اقتباس
0 Mustafa Suleiman نشر 25 يونيو أرسل تقرير نشر 25 يونيو عليك بتوجيه الأداة لاستخدام Intl.DateTimeFormat API المتاحة في المتصفح، وبمثال بسيط ستكتب السكريبت التالي: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="dual-calendar-container"> <p class="gregorian-date"></p> <p class="hijri-date"></p> </div> <script> document.addEventListener('DOMContentLoaded', function() { const today = new Date(); const gregorianOptions = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; const gregorianDateFormatter = new Intl.DateTimeFormat('ar-EG', gregorianOptions); const gregorianDateString = gregorianDateFormatter.format(today); const hijriOptions = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', }; const hijriDateFormatter = new Intl.DateTimeFormat('ar-SA-u-ca-islamic-umalqura', hijriOptions); const hijriDateString = hijriDateFormatter.format(today); const container = document.getElementById('dual-calendar-container'); if (container) { container.querySelector('.gregorian-date').textContent = `الميلادي: ${gregorianDateString}`; container.querySelector('.hijri-date').textContent = `الهجري: ${hijriDateString}`; } }); </script> </body> </html> اقتباس
السؤال
Rol Ian
كيف يمكن أن أقوم بتصميم تقويم يشمل التاريخ الهجري والميلادي في موقع Lovable.dev وتكون الأوقات صحيحة
لأنه يظهر التاريخ الهجري خاطئ غير متوافق مع الميلادي
تم التعديل في بواسطة Rol Ian1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.