aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-11 17:33:38 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-11 17:33:38 +0200
commit3ef9afb25d61bb9c9a1f3d0953efe015535aeda8 (patch)
treec911d794da3af5356c339bf5ab39a5ab23f24678
parentBreak out bind_properties function. (diff)
downloadcalp-3ef9afb25d61bb9c9a1f3d0953efe015535aeda8.tar.gz
calp-3ef9afb25d61bb9c9a1f3d0953efe015535aeda8.tar.xz
{time => date}_to_percent.
-rw-r--r--static/script.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/static/script.js b/static/script.js
index a2643bef..edef739a 100644
--- a/static/script.js
+++ b/static/script.js
@@ -5,9 +5,9 @@ function round_time (time, fraction) {
return Math.round (time * scale) / scale;
}
-function time_to_percent (time) {
+function date_to_percent (date) {
// Decimal time
- return (time.getHours() + (time.getMinutes() / 60)) * 100/24 + "%"
+ return (date.getHours() + (date.getMinutes() / 60)) * 100/24;
}
function parents_until (element, obj) {
@@ -189,7 +189,7 @@ function update_current_time_bar () {
bar_object.id = "bar"
}
- bar_object.style.top = time_to_percent(now)
+ bar_object.style.top = date_to_percent(now) + "%";
event_area.append(bar_object)
}