Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BeSafePlus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Kristensen
BeSafePlus
Commits
a7c8a87e
Commit
a7c8a87e
authored
1 week ago
by
MarcusStorvangJonassen
Browse files
Options
Downloads
Patches
Plain Diff
Now all three fields in ActivityHistoryPage is in sync
parent
e3303fe0
No related branches found
Branches containing commit
No related tags found
1 merge request
!37
Frontend ui
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
+23
-1
23 additions, 1 deletion
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
with
23 additions
and
1 deletion
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
+
23
−
1
View file @
a7c8a87e
...
...
@@ -101,13 +101,35 @@ namespace BeSafePlus.ViewModels
TotalStepsThisWeek
=
WeeklyStepData
.
Sum
(
data
=>
data
.
Steps
);
await
LoadMonthlySteps
();
var
todayMonthlyEntry
=
MonthlyStepData
.
FirstOrDefault
(
data
=>
DateTime
.
Parse
(
data
.
Date
).
Date
==
today
);
if
(
todayMonthlyEntry
==
null
)
{
todayMonthlyEntry
=
new
StepCount
{
Date
=
today
.
ToString
(
"yyyy-MM-dd"
),
Steps
=
steps
};
MonthlyStepData
.
Add
(
todayMonthlyEntry
);
}
else
{
todayMonthlyEntry
.
Steps
=
steps
;
}
var
firstDayOfMonth
=
new
DateTime
(
today
.
Year
,
today
.
Month
,
1
);
var
lastDayOfMonth
=
firstDayOfMonth
.
AddMonths
(
1
).
AddDays
(-
1
);
TotalStepsThisMonth
=
MonthlyStepData
.
Where
(
data
=>
DateTime
.
Parse
(
data
.
Date
)
>=
firstDayOfMonth
&&
DateTime
.
Parse
(
data
.
Date
)
<=
lastDayOfMonth
)
.
Sum
(
data
=>
data
.
Steps
);
OnPropertyChanged
(
nameof
(
WeeklyStepData
));
OnPropertyChanged
(
nameof
(
TotalStepsThisWeek
));
OnPropertyChanged
(
nameof
(
AccumulatedSteps
));
OnPropertyChanged
(
nameof
(
TotalStepsThisMonth
));
});
}
public
void
SetProgress
(
int
steps
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment