Skip to content
Snippets Groups Projects
Commit f1c241db authored by MarcusStorvangJonassen's avatar MarcusStorvangJonassen
Browse files

Fix to ActivityHistoryPage part 2

parent a7c8a87e
No related branches found
No related tags found
1 merge request!37Frontend ui
......@@ -241,16 +241,27 @@ namespace BeSafePlus.ViewModels
int totalSteps = 0;
var newMonthlyData = new List<StepCount>();
for (var date = firstDayOfMonth; date <= lastDayOfMonth; date = date.AddDays(1))
{
var stepData = await _database.GetStepCountByDate(date);
if (stepData != null)
{
newMonthlyData.Add(stepData);
totalSteps += stepData.Steps;
}
else
{
newMonthlyData.Add(new StepCount { Date = date.ToString("yyyy-MM-dd"), Steps = 0 });
}
}
MonthlyStepData = newMonthlyData;
TotalStepsThisMonth = totalSteps;
}
private string GetWeekLabel()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment