From 49ebd5b5760d15d3ae00b0c6eb2c97e3398ba212 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 3 Jan 2023 17:31:28 +0100 Subject: [PATCH] fixed visual bug in calendar --- .../include/javascript/pandora_fullcalendar.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/javascript/pandora_fullcalendar.js b/pandora_console/include/javascript/pandora_fullcalendar.js index 67e39f0e4c..853405eb1c 100644 --- a/pandora_console/include/javascript/pandora_fullcalendar.js +++ b/pandora_console/include/javascript/pandora_fullcalendar.js @@ -388,12 +388,11 @@ function recalculate_events(calendar, newEvent, from, to, create) { } }); - var title = ""; - if (time_format(from) === "00:00:00" && time_format(to) === "00:00:00") { - title = "All day"; - } - if (create === true) { + var title = ""; + if (time_format(from) === "00:00:00" && time_format(to) === "00:00:00") { + title = "All day"; + } calendar.addEvent({ title: title, start: from, @@ -401,6 +400,12 @@ function recalculate_events(calendar, newEvent, from, to, create) { id: uniqId() }); } else { + if (!$.isEmptyObject(newEvent)) { + newEvent._def.title = ""; + if (time_format(from) === "00:00:00" && time_format(to) === "00:00:00") { + newEvent._def.title = "All day"; + } + } // Update event. newEvent.setDates(from, to); }