Merge "UTC times can be confusing, explain times better"
This commit is contained in:
commit
220832e547
@ -9,6 +9,7 @@
|
||||
"slots": {
|
||||
"Monday": [
|
||||
{
|
||||
"realtime": "2020-06-01T09:00:00Z",
|
||||
"desc": "09:00-10:45",
|
||||
"name": "MonA1"
|
||||
},
|
||||
|
@ -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|}}
|
||||
|
19
html/ptg.js
19
html/ptg.js
@ -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…
Reference in New Issue
Block a user