Difference between revisions of "Widget:WFSP-Dashboard"

From Open Energy Information

(modified turbines reporting last month)
Line 330: Line 330:
 
             var lastReported = new Date((itemData[i].last_reported).concat(" UTC"));
 
             var lastReported = new Date((itemData[i].last_reported).concat(" UTC"));
  
             var oneWeekAgo = new Date();
+
             var oneMonthAgo = new Date();
             oneWeekAgo.setDate(oneWeekAgo.getDate() - 7);
+
             oneMonthAgo.setDate(oneMonthAgo.getDate() - 30);
  
             if (lastReported > oneWeekAgo) {reportingProjects += 1};
+
             if (lastReported > oneMonthAgo) {reportingProjects += 1};
  
 
             wfspEnergy += turbineEnergy;
 
             wfspEnergy += turbineEnergy;
Line 350: Line 350:
 
             $('tr[data-id="'+turbineID+'"]').append('<td>'+turbinePower+'</td><td>'+turbineWindSpeed+'</td><td>'+turbineDailyEnergy+'</td><td>'+turbineEnergy+'</td><td>'+turbineStatus+'</td><td class="alert '+statusCode+'">'+systemStatus+'</td><td>'+String(lastReported).slice(0,21)+'</td>');
 
             $('tr[data-id="'+turbineID+'"]').append('<td>'+turbinePower+'</td><td>'+turbineWindSpeed+'</td><td>'+turbineDailyEnergy+'</td><td>'+turbineEnergy+'</td><td>'+turbineStatus+'</td><td class="alert '+statusCode+'">'+systemStatus+'</td><td>'+String(lastReported).slice(0,21)+'</td>');
 
           }
 
           }
          // console.log(reportingProjects);
 
 
           totalProjects = Object.keys(latestData).length;
 
           totalProjects = Object.keys(latestData).length;
 
           //health = Math.round((runningProjects/totalProjects)*100);
 
           //health = Math.round((runningProjects/totalProjects)*100);

Revision as of 13:26, 27 September 2017

This widget helps with Wind for Schools Portal Dashboard content.

{{#Widget:WFSP-Dashboard}}