Get profile for specific time for percentage -> absolute conversion

This commit is contained in:
Mark Carrington 2018-08-02 12:27:56 +01:00
parent f9fb4c1bc5
commit 7be49571ae

View file

@ -82,7 +82,7 @@ public class NSUpload {
try { try {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
boolean useAbsolute = SP.getBoolean("ns_sync_use_absolute", false); boolean useAbsolute = SP.getBoolean("ns_sync_use_absolute", false);
Profile profile = ProfileFunctions.getInstance().getProfile(); Profile profile = ProfileFunctions.getInstance().getProfile(temporaryBasal.date);
double absoluteRate = 0; double absoluteRate = 0;
if (profile != null) { if (profile != null) {
absoluteRate = profile.getBasal(temporaryBasal.date) * temporaryBasal.percentRate / 100d; absoluteRate = profile.getBasal(temporaryBasal.date) * temporaryBasal.percentRate / 100d;