Change the way score are grouped

This commit is contained in:
2016-03-20 08:19:57 -04:00
parent 7da4ddf91b
commit 2d87076a48
2 changed files with 2 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ public class ScoreListTest
{
toggleRepetitions(0, 20);
int expectedValues[] = { 12629351, 11006461, 7272612, 2800230 };
int expectedValues[] = { 11434978, 7894999, 3212362 };
int actualValues[] = habit.scores.getAllValues(7);
assertThat(actualValues, equalTo(expectedValues));

View File

@@ -218,7 +218,7 @@ public class ScoreList
compute(from, to);
divisor *= DateHelper.millisecondsInOneDay;
Long offset = to + divisor - 1;
Long offset = to + divisor;
String query = "select ((timestamp - ?) / ?) as time, avg(score) from Score " +
"where habit = ? and timestamp >= ? and timestamp <= ? " +