Revert "Revert "allow temp basals for last two days""

This reverts commit 683cb3be63.
This commit is contained in:
Ben West
2016-08-04 16:33:26 -07:00
parent 835dcea887
commit abc847b434
+3 -3
View File
@@ -114,9 +114,9 @@ function mergeToTreatments (ddata, results) {
});
//filter out temps older than a day and an hour ago since we don't display them
var oneDayAgo = ddata.lastUpdated - ONE_DAY - times.hour().msecs;
var oldestAgo = ddata.lastUpdated - TWO_DAYS - times.hour().msecs;
treatments = _.filter(treatments, function noOldTemps (treatment) {
return !treatment.eventType || treatment.eventType.indexOf('Temp Basal') === -1 || treatment.mills > oneDayAgo;
return !treatment.eventType || treatment.eventType.indexOf('Temp Basal') === -1 || treatment.mills > oldestAgo;
});
ddata.treatments = _.union(ddata.treatments, treatments);
@@ -248,4 +248,4 @@ function loadDeviceStatus (ddata, env, ctx, callback) {
});
}
module.exports = init;
module.exports = init;