mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Sort week before prepareHtml
This commit is contained in:
@@ -91,15 +91,17 @@ weektoweek.report = function report_weektoweek(datastorage,sorteddaystoshow,opti
|
||||
}
|
||||
});
|
||||
|
||||
weekstoshow = weekstoshow.map(weekstoshow, function orderWeek(week) {
|
||||
return _.sortBy(week);
|
||||
});
|
||||
|
||||
weektoweek.prepareHtml(weekstoshow);
|
||||
|
||||
weekstoshow.forEach( function eachWeek(week) {
|
||||
var sgvData = [ ];
|
||||
var currDay = 0;
|
||||
|
||||
var sorted_week = _.sortBy(week);
|
||||
|
||||
sorted_week.forEach( function eachDay(day) {
|
||||
week.forEach( function eachDay(day) {
|
||||
console.log('Rectifying day: ' + day);
|
||||
console.log('First sgv: ' + datastorage[day].sgv[0].date + ' last sgv: ' + datastorage[day].sgv[datastorage[day].sgv.length - 1].date);
|
||||
datastorage[day].sgv.forEach ( function eachSgv(sgv) {
|
||||
@@ -121,7 +123,7 @@ weektoweek.report = function report_weektoweek(datastorage,sorteddaystoshow,opti
|
||||
currDay += 1;
|
||||
});
|
||||
|
||||
drawChart(sorted_week, sgvData, options);
|
||||
drawChart(week, sgvData, options);
|
||||
});
|
||||
|
||||
function timeTicks(n,i) {
|
||||
|
||||
Reference in New Issue
Block a user