|
|
@@ -20,6 +20,24 @@
|
|
|
<% const date = new Date() %>
|
|
|
|
|
|
<header>
|
|
|
- <p><%~ timeIcon %> <%= date.getHours() %>:<%= date.getMinutes() %></p>
|
|
|
- <p><%= date.getDate() %>. <%= date.getMonth() + 1 %>. <%= date.getFullYear() %> <%~ dateIcon %></p>
|
|
|
+ <p><%~ timeIcon %> <span id="topbarTime"><%= date.getHours() %>:<%= date.getMinutes() %></span></p>
|
|
|
+ <p><span id="topbarDate"><%= date.getDate() %>. <%= date.getMonth() + 1 %>. <%= date.getFullYear() %></span> <%~ dateIcon %></p>
|
|
|
+
|
|
|
+ <script defer>
|
|
|
+ setInterval(() => {
|
|
|
+ const topbarTime = document.querySelector("#topbarTime")
|
|
|
+ const topbarDate = document.querySelector("#topbarDate")
|
|
|
+
|
|
|
+ const date = new Date()
|
|
|
+
|
|
|
+ const timeString = `${date.getHours() }:${date.getMinutes()}:${date.getSeconds().toString().padStart(2, `0`)}`
|
|
|
+ const dateString = `${date.getDate() }. ${date.getMonth() + 1 }. ${date.getFullYear()}`
|
|
|
+
|
|
|
+ topbarTime.textContent = timeString
|
|
|
+
|
|
|
+ if (topbarDate.textContent !== dateString) {
|
|
|
+ topbarDate.textContent = dateString
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ </script>
|
|
|
</header>
|