From b6b7955ddeca74085a750178d258f5eeae9bef45 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Mon, 19 Mar 2018 20:03:15 +0100 Subject: [PATCH] TDD 07 --- .../java/info/nightscout/androidaps/TDDStatsActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java index 4f38490686..48ae30f6d2 100644 --- a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java @@ -386,9 +386,14 @@ public class TDDStatsActivity extends Activity { TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); - sum = sum + tdd; + i++; + if(df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { + break; + } + + sum = sum + tdd; // Create the cumtable row TableRow ctr = new TableRow(TDDStatsActivity.this); if (i % 2 == 0) ctr.setBackgroundColor(Color.DKGRAY);