(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 += `| ${monthNames[month]} ${year} |
`;
calendarHTML += '| Su | Mo | Tu | We | Th | Fr | Sa |
';
for(let i=0;i";
for(let day=1;day<=daysInMonth;day++){
const current = new Date(year, month, day);
const isToday = (current.toDateString() === today.toDateString());
calendarHTML += `| ${day} | `;
if((firstDay + day) % 7 === 0) calendarHTML += "
";
}
calendarHTML += "
";
document.getElementById("smalleasy-calendar").innerHTML = calendarHTML;
}
updateDateTime();
renderCalendar();
setInterval(updateDateTime, 1000);
})();