uses UTC dates as an attempt to fix heatmap's rendering bug.

This commit is contained in:
Faris Armoush
2025-06-27 22:09:00 +03:00
parent 3fc6964e15
commit 13e9a808ab
2 changed files with 4 additions and 4 deletions

View File

@ -20,14 +20,14 @@ class OccupancyHeatMap extends StatelessWidget {
: 0;
DateTime _getStartingDate() {
final jan1 = DateTime(DateTime.now().year, 1, 1).toUtc();
final jan1 = DateTime.utc(DateTime.now().year, 1, 1);
final startOfWeek = jan1.subtract(Duration(days: jan1.weekday - 1));
return startOfWeek;
}
List<OccupancyPaintItem> _generatePaintItems(DateTime startDate) {
return List.generate(_totalWeeks * 7, (index) {
final date = startDate.toUtc().add(Duration(days: index));
final date = startDate.add(Duration(days: index));
final value = heatMapData[date] ?? 0;
return OccupancyPaintItem(index: index, value: value, date: date);
});