From ae0e095995048d717e9b1d4515b36c8f861ec5eb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Jul 2017 12:57:43 +0200 Subject: [locationinfo] Try working around messy time handling (timezones etc), CSS Webkit/Presto and Blink/Gecko (or rather the corresponding JS engine) disagree about how to handle certain date format strings wrt. time zones. This leads to nasty discrepancies of events being displayed in the calendar. (Unfortunately the students working on this project could not be convinced that properly handling time zones when dealing with time information should be considered important.) Also, some tweaks to CSS/layout have been implemented so the design isn't as messed up on old webkits that don't support flex layout. --- .../locationinfo/frontend/doorsign.html | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'modules-available/locationinfo/frontend/doorsign.html') diff --git a/modules-available/locationinfo/frontend/doorsign.html b/modules-available/locationinfo/frontend/doorsign.html index 97504284..8acdb07b 100755 --- a/modules-available/locationinfo/frontend/doorsign.html +++ b/modules-available/locationinfo/frontend/doorsign.html @@ -58,6 +58,14 @@ optional: justify-content: space-between; } + .pull-left { + float: left; + } + + .clearfix { + clear: both; + } + .col { padding: 0 4px; color: white; @@ -67,6 +75,8 @@ optional: } .col-square { + order: 1000; + float: right; width: 46pt; width: 4vw; height: 46pt; @@ -147,6 +157,7 @@ optional: .center { text-align: center; + margin: auto; } .room-layout { @@ -439,7 +450,15 @@ optional: return; } - var time = new Date(result.time); + var time = false; + var p = result.time.split('-'); + if (p.length === 6) { + time = new Date(p[0], p[1], p[2], p[3], p[4], p[5]); + console.log(time); + } + if (time === false || isNaN(time.getTime()) || time.getYear() < 2010) { + time = new Date(result.time); + } if (isNaN(time.getTime()) || time.getYear() < 2010) { time = new Date(); } @@ -587,7 +606,7 @@ optional: $("body").append($loc); room.$.container = $loc; - room.$.locationName = $('
').addClass('col').addClass('header-font'); + room.$.locationName = $('
').addClass('col').addClass('header-font').addClass('pull-left'); room.$.currentEvent = $("").addClass('nowrap'); room.$.currentRemain = $("").addClass('nowrap').addClass('timer'); room.$.seatsCounter = $('').addClass('seats-counter'); @@ -595,10 +614,11 @@ optional: var $header = $('
').addClass('row').addClass('count-' + roomIds.length); $header.append(room.$.locationName); - $header.append($('
').addClass('col header-font center').append(room.$.currentEvent).append(' ').append(room.$.currentRemain)); $header.append(room.$.seatsBackground); + $header.append($('
').addClass('col header-font center').append(room.$.currentEvent).append(' ').append(room.$.currentRemain)); room.$.header = $header; $loc.append($header); + $header.append('
'); if (room.name !== null) { room.$.locationName.text(room.name); @@ -941,6 +961,9 @@ optional: console.log("Error: Calendar data was empty or malformed."); return; } + if (json.length === 0) { + console.log("Notice: Calendar already empty from server"); + } var now = MyDate().getTime(); json = json.filter(function (el) { if (!el.title || !el.start || !el.end) return false; -- cgit v1.2.3-55-g7522