From fa00f4cf3d13e3a5add17432e9acaa7f696f9216 Mon Sep 17 00:00:00 2001 From: axtlos Date: Tue, 6 May 2025 23:30:53 +0200 Subject: Add second indicator to clock --- index.html | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 9622bff..e51e31c 100644 --- a/index.html +++ b/index.html @@ -301,26 +301,30 @@ }); - + const colon = colonVisible ? ':' : ' '; + document.getElementById('time').textContent = `${displayHours}${colon}${displayMinutes}`; + colonVisible = !colonVisible; + + const days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']; + const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']; + document.getElementById('day').textContent = days[now.getDay()]; + document.getElementById('date').textContent = now.getDate(); + document.getElementById('month').textContent = months[now.getMonth()]; + } + + updateClockAndCalendar(); + setInterval(updateClockAndCalendar, 1000); + -- cgit v1.2.3