Skip to content

Commit

Permalink
Update page title
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmaxwell committed Nov 26, 2024
1 parent 359f876 commit 0ff64a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion home/templates/home/home.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends "_base.html" %}

{% load static %}

{% block title %}Home{% endblock %}

{% block head %}
<style>
body {
Expand Down Expand Up @@ -48,6 +49,7 @@
<script>
function updateClock() {
const now = new Date();
const baseTitle = "Home";

const timeOptions = { hour12: false, hour: '2-digit', minute: '2-digit' };
const timeStr = now.toLocaleTimeString('en-NZ', timeOptions);
Expand All @@ -57,6 +59,8 @@

document.getElementById('clock').textContent = timeStr;
document.getElementById('date').textContent = dateStr;
document.title = `Home ${timeStr}`;

}

updateClock();
Expand Down

0 comments on commit 0ff64a8

Please sign in to comment.