time and date

(function(){ const container = document.getElementById("smalleasy-widget"); if(!container) return; const widget = document.createElement("div"); widget.style.cssText = "display:inline-block;padding:12px;border-radius:10px;background:#f8f8f8;color:#333;font-family:Arial,sans-serif;text-align:center;width:260px;"; widget.innerHTML = `
`; container.appendChild(widget); function updateDateTime(){ const now = new Date(); const dateOptions = { weekday:'long', year:'numeric', month:'long', day:'numeric' }; document.getElementById("smalleasy-date").textContent = now.toLocaleDateString('en-US', dateOptions); document.getElementById("smalleasy-time").textContent = now.toLocaleTimeString('en-US', { hour12:true }); } function renderCalendar(){ const today = new Date(); const monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"]; const month = today.getMonth(); const year = today.getFullYear(); const firstDay = new Date(year, month, 1).getDay(); const daysInMonth = new Date(year, month + 1, 0).getDate(); let calendarHTML = ''; calendarHTML += ``; calendarHTML += ''; for(let i=0;i${day}`; if((firstDay + day) % 7 === 0) calendarHTML += ""; } calendarHTML += "
${monthNames[month]} ${year}
SuMoTuWeThFrSa
"; document.getElementById("smalleasy-calendar").innerHTML = calendarHTML; } updateDateTime(); renderCalendar(); setInterval(updateDateTime, 1000); })();