Browse Source

Merge "UTC times can be confusing, explain times better"

changes/37/731737/1
Zuul 5 months ago
committed by Gerrit Code Review
parent
commit
220832e547
3 changed files with 20 additions and 2 deletions
  1. +1
    -0
      base.json
  2. +1
    -1
      html/ptg.html
  3. +18
    -1
      html/ptg.js

+ 1
- 0
base.json View File

@@ -9,6 +9,7 @@
"slots": {
"Monday": [
{
"realtime": "2020-06-01T09:00:00Z",
"desc": "09:00-10:45",
"name": "MonA1"
},


+ 1
- 1
html/ptg.html View File

@@ -112,7 +112,7 @@
<table class="table table-condensed">
<thead><tr><th></th>
{{#each times as |time|}}
<th>{{time.desc}}</th>
<th>{{ displaytime time }}</th>
{{/each}}
</tr></thead>
{{#each @root.schedule as |sched room|}}


+ 18
- 1
html/ptg.js View File

@@ -102,10 +102,27 @@ Handlebars.registerHelper('roomcode',
return new Handlebars.SafeString(cell);
});

Handlebars.registerHelper('displaytime',
function(time) {
if (time['realtime'] != undefined) {
var t = new Date(time['realtime']);
content = '<a target="_blank" href="' +
'https://www.timeanddate.com/worldclock/fixedtime.html?iso=' +
time['realtime'] + '" title="' + t + '">' +
time['desc'] +'</a>';
} else {
content = time['desc'];
}
return new Handlebars.SafeString(content);
});


// What is the day today ?
// Return Monday until Tuesday 1 UTC
var now = new Date();
now.setHours(now.getHours()-1);
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
var day = days[ now.getDay() ];
var day = days[ now.getUTCDay() ];
var checkins = {};

$.getJSON("ptg.json", function(json) {


Loading…
Cancel
Save