1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-12-23 14:49:12 +00:00

use dedicated function to get pretty-printed time from pretalx

This commit is contained in:
Franziska Kunsmann 2023-03-01 14:07:54 +01:00
parent aa91af001c
commit 8b7acb10fb
2 changed files with 18 additions and 2 deletions

View file

@ -70,6 +70,23 @@ function get_room_name() {
return room_name;
}
function format_time_from_pretalx(from_pretalx) {
d = new Date(from_pretalx);
h = d.getHours();
m = d.getMinutes();
if (h < 10) {
h = '0' + h;
}
if (m < 10) {
m = '0' + m;
}
return h + ':' + m;
}
function update_schedule() {
$.getJSON('../event.json', function(data) {
event_info = data;

View file

@ -64,8 +64,7 @@ function update_room_info() {
$('#broadcast_tools_room_info_qr').text('');
if (next_talk && event_info['room-info']['show_next_talk']) {
next_time = new Date(next_talk['start']);
$('#broadcast_tools_room_info_speaker').text(next_time.getHours() + ':' + next_time.getMinutes() + ' ' + next_talk['title']);
$('#broadcast_tools_room_info_speaker').text(format_time_from_pretalx(next_talk['start']) + ' ' + next_talk['title']);
} else {
$('#broadcast_tools_room_info_speaker').text('');
}