Skip to content

Commit

Permalink
Calendar using season config option
Browse files Browse the repository at this point in the history
  • Loading branch information
ianperrin committed Mar 8, 2017
1 parent ca02965 commit 146453f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions MMM-Formula1.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Module.register("MMM-Formula1",{
return loadingWrapper;
}

if ( (this.config.type === 'DRIVER' && this.ergastData.DRIVER.StandingsTable.StandingsLists.length === 0)
|| (this.config.type != 'DRIVER' && this.ergastData.CONSTRUCTOR.StandingsTable.StandingsLists.length === 0) ) {
var noDataWrapper = document.createElement("div");
noDataWrapper.innerHTML = this.translate("NO DATA");
noDataWrapper.className = "small dimmed light";
return noDataWrapper;
}

var tableWrapper = document.createElement("table");
tableWrapper.className = "small";

Expand Down
2 changes: 1 addition & 1 deletion node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = NodeHelper.create({
console.log(this.name + " is fetching the race schedule");
var self = this;
// this.fetcherRunning = true;
ErgastAPI.getSchedule('current', function(raceSchedule) {
ErgastAPI.getSchedule(this.config.season, function(raceSchedule) {
if (raceSchedule && raceSchedule.updated) {
raceScheduleDB = raceSchedule;
self.sendSocketNotification('RACE_SCHEDULE', raceSchedule);
Expand Down

0 comments on commit 146453f

Please sign in to comment.