From 163f1a38bfa00feda91b93a3c931641298cbf98e Mon Sep 17 00:00:00 2001 From: tay Date: Fri, 20 Sep 2024 07:12:43 -0400 Subject: [PATCH] Adding timezone to my home page. --- content/pages/index.html | 1 + layouts/_default/home.html | 10 +++++++--- public/assets/js/timezone.js | 13 +++++++++++++ public/index.html | 10 +++++++--- public/index.xml | 2 +- public/pages/index.html | 13 +++++++------ static/assets/js/timezone.js | 13 +++++++++++++ 7 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 public/assets/js/timezone.js create mode 100644 static/assets/js/timezone.js diff --git a/content/pages/index.html b/content/pages/index.html index ad1ba43..5cff66c 100644 --- a/content/pages/index.html +++ b/content/pages/index.html @@ -8,6 +8,7 @@
  • Projects - Takes you to my Projects page.
  • Discord - Redirects you to my Discord.
  • Pages - Takes you to this page.
  • +
  • README - Takes you to my README page.
  • Blog - Takes you to my Substack.
  • diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 76a337d..4b18953 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -1,9 +1,13 @@ {{ define "main" }}
    -
    -

    Hello and Welcome, My name is Tee.

    +
    +

    time

    + +

    Hello and Welcome, My name is Tee.

    +

    I like to go by Tee, Rhea, or Kara.

    +

    I like to go by Tee, Rhea, or Kara.

    +
    -
    {{ end }} \ No newline at end of file diff --git a/public/assets/js/timezone.js b/public/assets/js/timezone.js new file mode 100644 index 0000000..bbbf22e --- /dev/null +++ b/public/assets/js/timezone.js @@ -0,0 +1,13 @@ +function displayDateTime() { + const timeZone = 'America/New_York'; + const options = { + hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: timeZone, + timeZoneName: 'short' + }; + + const currentTime = new Date().toLocaleString('en-US', options); + document.getElementById('date-time').innerHTML = `It is ${currentTime} for Tee`; +} + +setInterval(displayDateTime, 1000); +window.onload = displayDateTime; diff --git a/public/index.html b/public/index.html index d3ff7b7..f152feb 100644 --- a/public/index.html +++ b/public/index.html @@ -45,10 +45,14 @@
    -
    -

    Hello and Welcome, My name is Tee.

    +
    +

    time

    + +

    Hello and Welcome, My name is Tee.

    +

    I like to go by Tee, Rhea, or Kara.

    +

    I like to go by Tee, Rhea, or Kara.

    +
    -