Islamic Date Today Pakistan & World :root { --green: #0b8d4b; --green-light: #ecfdf5; --dark: #1f2937; --light: #f4f7f6; --white: #ffffff; --gray-text: #6b7280; --border: #edf2f7; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Poppins', sans-serif; background: var(--light); padding: 12px; color: var(--dark); font-size: 11px; line-height: 1.4; } /* MAIN CONTAINER */ .wrapper { max-width: 500px; margin: 0 auto; display: block; } /* BLOCK STRUCTURAL ELEMENT */ .block { display: block; background: var(--white); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.04); } /* HERO BLOCK */ .hero-block { background: linear-gradient(135deg, #0b8d4b, #06663b); color: var(--white); text-align: center; } .hero-title { display: block; font-size: 18px; font-weight: 600; margin-bottom: 2px; } .hero-subtext { display: block; font-size: 11px; opacity: .92; font-weight: 300; } /* DATA BLOCK SPECIFICS */ .block-label { display: block; font-size: 10px; text-transform: uppercase; color: var(--gray-text); font-weight: 600; margin-bottom: 4px; } .block-value { display: block; font-size: 13px; font-weight: 600; } .green-accent-block { background: var(--green-light); border-left: 4px solid var(--green); } /* REGIONAL TABLE (BLOCK MODEL) */ .table-block { display: block; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.04); margin-bottom: 10px; } .table-header { display: block; background: #111827; color: var(--white); padding: 10px 14px; font-size: 11px; font-weight: 600; } .table-row { display: block; padding: 10px 14px; border-top: 1px solid var(--border); } .table-row-active { background: #f0fff4; color: var(--green); font-weight: 600; } /* Double block wrapper inside rows to replace flex justifies */ .row-left { display: block; float: left; width: 50%; text-align: left; } .row-right { display: block; float: right; width: 50%; text-align: right; } .clearfix::after { content: ""; clear: both; display: table; } /* MONTHS CONTAINER */ .month-section { display: block; margin-top: 12px; } .month-section-title { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--green); } .month-row { display: block; margin-bottom: 6px; } .month-card-split { display: block; float: left; width: 49.3%; background: var(--white); border-radius: 8px; padding: 8px 12px; box-shadow: 0 2px 4px rgba(0,0,0,.02); border: 1px solid var(--border); } .month-card-split:last-child { float: right; } .month-card-split.active { background: var(--green); color: var(--white); border-color: var(--green); } .card-left { display: block; float: left; font-size: 11px; font-weight: 500; } .card-right { display: block; float: right; font-size: 10px; color: #94a3b8; } .active .card-right { color: #d1fae5; font-weight: 600; } /* RESPONSIVE LAYOUT BREAKDOWN */ @media(max-width: 400px) { .month-card-split { width: 100%; float: none; margin-bottom: 6px; } .month-card-split:last-child { float: none; margin-bottom: 0; } } Islamic Date Today Gregorian Date World Islamic Date Pakistan Islamic Date Regional Islamic Calendar Global / Saudi Arabia Pakistan Islamic Months const islamicMonths = [ "Muharram", "Safar", "Rabi al-Awwal", "Rabi al-Thani", "Jumada al-Awwal", "Jumada al-Thani", "Rajab", "Sha'ban", "Ramadan", "Shawwal", "Dhu al-Qi'dah", "Dhu al-Hijjah" ]; function getHijriDate(date, dayOffset = 0) { const referenceDate = new Date(Date.UTC(2026, 4, 26)); const referenceHijriDay = 9 + dayOffset; const referenceMonth = 11; const referenceYear = 1447; const oneDay = 1000 * 60 * 60 * 24; let diffDays = Math.floor((date - referenceDate) / oneDay); let day = referenceHijriDay + diffDays; let month = referenceMonth; let year = referenceYear; const monthDays = [30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29]; while (day > monthDays[month]) { day -= monthDays[month]; month++; if (month > 11) { month = 0; year++; } } while (day <= 0) { month--; if (month < 0) { month = 11; year--; } day += monthDays[month]; } return { day, month, year, monthName: islamicMonths[month] }; } function updateWidget() { const pakistanNow = new Date(new Date().toLocaleString("en-US", { timeZone: "Asia/Karachi" })); const gregorian = pakistanNow.toLocaleDateString('en-PK', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric', timeZone: 'Asia/Karachi' }); const hijriPakistan = getHijriDate(pakistanNow, 0); const hijriWorld = getHijriDate(pakistanNow, 0); const pakText = `${hijriPakistan.day} ${hijriPakistan.monthName} ${hijriPakistan.year} AH`; const worldText = `${hijriWorld.day} ${hijriWorld.monthName} ${hijriWorld.year} AH`; document.getElementById('gregorianDate').textContent = gregorian; document.getElementById('worldDate').textContent = worldText; document.getElementById('pakistanDate').textContent = pakText; document.getElementById('tableWorld').textContent = worldText; document.getElementById('tablePakistan').textContent = pakText; document.getElementById('liveTime').textContent = pakistanNow.toLocaleTimeString('en-PK', { hour: '2-digit', minute: '2-digit', second: '2-digit', timeZone: 'Asia/Karachi' }) + ' PKT'; // Rebuilt for pure block structures let html = ''; for (let i = 0; i < islamicMonths.length; i += 2) { const index1 = i; const index2 = i + 1; const active1 = index1 === hijriPakistan.month ? 'active' : ''; const active2 = (index2 < islamicMonths.length && index2 === hijriPakistan.month) ? 'active' : ''; html += `<div class="month-row clearfix">`; html += ` <div class="month-card-split ${active1}"> <span class="card-left">${islamicMonths[index1]}</span> <span class="card-right">${index1 + 1}</span> </div> `; if (index2 < islamicMonths.length) { html += ` <div class="month-card-split ${active2}"> <span class="card-left">${islamicMonths[index2]}</span> <span class="card-right">${index2 + 1}</span> </div> `; } html += `</div>`; } document.getElementById('monthsContainer').innerHTML = html; } updateWidget(); setInterval(updateWidget, 1000);