aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-14 22:29:29 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-14 22:29:29 +0200
commit99afbb4a288966b5228e95b449783625ae4e0b29 (patch)
treed36a06ddc1f6f826f8bbb3f48c8a72d28c696cfb
parentAdd TODO about id to functions JS. (diff)
downloadcalp-99afbb4a288966b5228e95b449783625ae4e0b29.tar.gz
calp-99afbb4a288966b5228e95b449783625ae4e0b29.tar.xz
Fix time input error after emptying.
-rw-r--r--static/script.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js
index 0f9dace9..6870819b 100644
--- a/static/script.js
+++ b/static/script.js
@@ -328,6 +328,8 @@ function place_in_edit_mode (event) {
required: true,
onchange: function (e) {
+ /* Only update datetime when the input is filled out */
+ if (! this.value) return;
let [hour, minute] = this.value.split(":").map(Number);
/* retain the year, month, and day information */
let d = copyDate(event.properties[fieldname]);