Zeitplan: Linie für die aktuelle Uhrzeit im heutigen Tag
This commit is contained in:
1 parent
94e1ad94e8
commit
9fdcb888aa
3 files changed
+35
No files matched your search
@@ -1463,6 +1463,21 @@ async function schedulePage() {
|
||||
h('span', { class: 'ev-kind' }, KIND_LABEL[e.kind.kind]), h('span', { class: 'mono' }, e.subject),
|
||||
e.note ? h('span', {}, e.note) : null, h('span', { class: 'ev-by' }, 'von ' + creator(e)), h('span', { class: 'mono' }, hhmm(from) + '–' + (to.getTime() === dayStart.getTime() + 86400000 ? '24:00' : hhmm(to)))));
|
||||
}
|
||||
// Linie für die aktuelle Uhrzeit im heutigen Tag, hält sich alle 30 Sekunden aktuell
|
||||
if (dayStart.toDateString() === new Date().toDateString()) {
|
||||
const line = h('div', { class: 'cal-now' }, h('span', {}));
|
||||
const place = () => {
|
||||
const now = new Date();
|
||||
line.style.top = ((now.getHours() * 60 + now.getMinutes()) / 60 * HOUR) + 'px';
|
||||
line.firstChild.textContent = hhmm(now);
|
||||
};
|
||||
place();
|
||||
const tick = setInterval(() => {
|
||||
if (!col.isConnected) return clearInterval(tick);
|
||||
place();
|
||||
}, 30000);
|
||||
col.append(line);
|
||||
}
|
||||
// Minuten seit Tagesbeginn an der Zeigerposition, auf halbe Stunden gerastert
|
||||
const minutes = (ev, round) => {
|
||||
const y = ev.clientY - col.getBoundingClientRect().top;
|
||||
|
||||
Reference in new issue
Block a user