[F.END] Lochescion: diesci

Location presentation in JS
This commit is contained in:
giuliof 2018-11-22 23:40:48 +01:00
parent 9670c3abc5
commit 6fa37096ea
1 changed files with 9 additions and 1 deletions

View File

@ -16,9 +16,17 @@ for (i in json_obj) {
console.log(JSON.stringify(json_obj[i]));
document.write('<h5 class="widget-title" style="font-style: italic; color: #009000;">'+json_obj[i]["NAME"]+'</h5>');
document.write("<div>📅 "+date.format("ddd D MMMM")+"</div>");
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("<div>⏰ "+time_str+"</div>");
// Probably is better to get a default location from Python?
if ("LOCATION" in json_obj[i] && json_obj[i]["LOCATION"] != '' )
document.write("<div>📍 "+json_obj[i]["LOCATION"]+"</div>");
else
document.write("<div>📍 Officina Informatica</div>");
}