@@ -77,7 +77,7 @@ extension Stat.StateModel {
from startDate: Date,
to endDate: Date
) async -> (carbs: Double, fat: Double, protein: Double) {
- let filteredStats = self.mealStats.filter { stat in
+ let filteredStats = mealStats.filter { stat in
stat.date >= startDate && stat.date <= endDate
}
@@ -158,7 +158,7 @@ struct BolusStatsView: View {
.chartScrollPosition(x: $scrollPosition)
.chartScrollTargetBehavior(
.valueAligned(
- matching: alignmentComponents,
+ matching: DateComponents(hour: 0), // Align to start of day
majorAlignment: .matching(alignmentComponents)
)
@@ -158,7 +158,7 @@ struct MealStatsView: View {
@@ -166,7 +166,7 @@ struct TDDChartView: View {