From 6fa37096eab115f434f8a898532ff6aa649355ef Mon Sep 17 00:00:00 2001 From: giuliof Date: Thu, 22 Nov 2018 23:40:48 +0100 Subject: [PATCH] [F.END] Lochescion: diesci Location presentation in JS --- frontend/frontend.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/frontend.js b/frontend/frontend.js index 8e0ffe8..54231a1 100644 --- a/frontend/frontend.js +++ b/frontend/frontend.js @@ -16,9 +16,17 @@ for (i in json_obj) { console.log(JSON.stringify(json_obj[i])); document.write('
'+json_obj[i]["NAME"]+'
'); document.write("
📅 "+date.format("ddd D MMMM")+"
"); + if (json_obj[i]["ALLDAY"] == true) time_str = "Tutto il giorno" else - time_str =date.format("H:mm") + time_str = date.format("H:mm") document.write("
⏰ "+time_str+"
"); + + // Probably is better to get a default location from Python? + if ("LOCATION" in json_obj[i] && json_obj[i]["LOCATION"] != '' ) + document.write("
📍 "+json_obj[i]["LOCATION"]+"
"); + else + document.write("
📍 Officina Informatica
"); + }