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:
parent
aa91af001c
commit
8b7acb10fb
2 changed files with 18 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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('');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue