Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match WHO Dashboard - Add one day to stats #1921

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion client/lib/components/recent_numbers_graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ class _RecentNumbersBarGraphState extends State<RecentNumbersBarGraph> {
final date = DateTime.fromMillisecondsSinceEpoch(
widget.timeseries[index].epochMsec.toInt());
// Abbr to fit on single line: e.g. "Oct 18, 2020"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move comment to the extension as the comment it common to both usages and not specific to line 78

final formattedDate = DateFormat.yMMMd().format(date);
final formattedDate = DateFormat.yMMMd().format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this to a shared method to avoid duplicated code.

This should also be heavily commented to explain why it exists.

date.add(
Duration(
days: 1,
),
),
);

final formattedCount = NumberFormat().format(barRodData.y);

Expand Down Expand Up @@ -272,6 +278,10 @@ class _RecentNumbersGraphState extends State<RecentNumbersGraph> {
return DateFormat.yMMMd().format(
DateTime.fromMillisecondsSinceEpoch(
epochsMilliseconds,
).add(
Duration(
days: 1,
),
),
);
}
Expand Down