Skip to content

Commit

Permalink
#112 add show current time
Browse files Browse the repository at this point in the history
  • Loading branch information
uchitsa committed Aug 19, 2024
1 parent 3891e06 commit 160d723
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions assets/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,7 @@ SOFTWARE.
</style>
<script type="text/javascript">
$(function() {
$("#facts").tablesorter();
function updateTime() {
var now = new Date();
var timeString = now.toLocaleTimeString();
$("#currentTime").text(timeString);
}
setInterval(updateTime, 1000);
updateTime();
$("#facts").tablesorter();
});
</script>
</head>
Expand Down Expand Up @@ -133,11 +126,19 @@ SOFTWARE.
<xsl:value-of select="fb/@version"/>
<xsl:text>.</xsl:text>
<br/>
<xsl:text>Current Time:</xsl:text>
<span id="currentTime"></span>
<span id="current-time">Loading current time...</span>
</p>
</footer>
</section>
<script type="text/javascript">
function updateTime() {
const now = new Date();
const timeElement = document.getElementById('current-time');
timeElement.textContent = `Current time: ${now.toLocaleString()}`;
}
updateTime();
setInterval(updateTime, 1000);
</script>
</body>
</html>
</xsl:template>
Expand Down

0 comments on commit 160d723

Please sign in to comment.