Skip to content
Permalink
Browse files

🐛 Bandemonium hotfix

  • Loading branch information...
ironman5366 committed Apr 21, 2019
1 parent 68841cc commit 77cd3dcc92c842f1051b1fff58f75129a9e593c2
Showing with 34 additions and 2 deletions.
  1. +1 −0 README.md
  2. +33 −2 page.js
@@ -1,5 +1,6 @@
# KRLX Desktop [![Build Status](https://travis-ci.org/ironman5366/KRLXDesktop.svg?branch=master)](https://travis-ci.org/ironman5366/KRLXDesktop)
A desktop app for [KRLX](http://www.krlx.org/), written in Electron
![Screenshot]: (https://imgur.com/m8YdQyy)

## Features:
- Displays current show and information, pulling host info from Carleton directory
35 page.js
@@ -131,14 +131,29 @@ function get_song_widget(song){
function get_show_widget(show, hosts){
let start_d = new Date();
let end_d = new Date();
if (!show.start){
show.start = "17:00"
}
if (!show.end){
show.end = "19:00"
}
if (!show.day){
show.day = start_d.getDay();
}
if (!show.description){
show.description = "No description found";
}
//[year, month, day, hour, minute, second, millisecond]
let start_split = show.start.split(":");
start_d.setHours(start_split[0], start_split[1]);
let end_split = show.end.split(":");
end_d.setHours(end_split[0], end_split[1]);
let start = moment(start_d);
let end = moment(end_d);
let remaining = end.toNow();
let remaining = end.fromNow();
if (remaining.includes("ago")){
remaining = end.toNow();
}
let card = "<div class=\"card\">\n" +
" <div class=\"card-body\">\n" +
" <h4 class=\"card-title\">"+show.title+"</h4>\n" +
@@ -159,13 +174,29 @@ function get_upcoming_widget(show){
let start_d = new Date();
let end_d = new Date();
//[year, month, day, hour, minute, second, millisecond]
// Fix bandemonium start end
if (!show.start){
show.start = "17:00"
}
if (!show.end){
show.end = "19:00"
}
if (!show.day){
show.day = start_d.getDay();
}
if (!show.description){
show.description = "No description found";
}
let start_split = show.start.split(":");
start_d.setHours(start_split[0], start_split[1]);
let end_split = show.end.split(":");
end_d.setHours(end_split[0], end_split[1]);
let start = moment(start_d);
let end = moment(end_d);
let until = start.toNow();
let until = start.fromNow();
if (until.includes("ago")){
until = start.toNow();
}
let widget = "<div class='card mb-3'>";
widget += "<div><div class='card-header'>" +
" <h5 class=\"card-title\">"+show.title+"</h5>\n" +

0 comments on commit 77cd3dc

Please sign in to comment.
You can’t perform that action at this time.