aboutsummaryrefslogtreecommitdiff
path: root/static/time.js
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2022-12-27 19:59:35 -0700
committerBryson Steck <brysonsteck@protonmail.com>2022-12-27 19:59:35 -0700
commit7323b01e42d573c12818f48e4b00ed8ff7736565 (patch)
tree0432e898678b1a8f6ac162f05f1898c6b02a8e79 /static/time.js
parent6ba510878f9f5e333e511e300d1bf20d0310d633 (diff)
downloadwebsite-7323b01e42d573c12818f48e4b00ed8ff7736565.tar
website-7323b01e42d573c12818f48e4b00ed8ff7736565.tar.gz
website-7323b01e42d573c12818f48e4b00ed8ff7736565.tar.bz2
added contact page, blog list, redid homepage
Diffstat (limited to 'static/time.js')
-rw-r--r--static/time.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/static/time.js b/static/time.js
index 3e5650d..ac093b1 100644
--- a/static/time.js
+++ b/static/time.js
@@ -1,27 +1,28 @@
+var colon = ":";
function updateTime(){
var date = new Date()
var hours = date.getHours()
var minutes = date.getMinutes()
- var seconds = date.getSeconds()
- var old_hours = hours;
- if (hours > 12) {
+ if (hours > 11)
+ var tod = " pm";
+ else
+ var tod = " am";
+
+ if (hours > 12)
hours = hours - 12
- } else if (hours == 0) {
+ else if (hours == 0)
hours = 12
- }
- if (minutes < 10) {
+ if (minutes < 10)
minutes = "0" + minutes
- }
- var t_str = hours + ":" + minutes;
- if (old_hours > 11) {
- t_str += " pm";
- } else {
- t_str += " am";
- }
+ if (colon === ":")
+ colon = " ";
+ else if (colon === " ")
+ colon = ":";
+ var t_str = hours + colon + minutes + tod;
document.getElementById('time').innerHTML = t_str;
}
-setInterval(updateTime, 1);
+setInterval(updateTime, 500);