Skip to content

Commit

Permalink
Fix calc weekday
Browse files Browse the repository at this point in the history
  • Loading branch information
bannzai committed Jun 4, 2022
1 parent dd98b86 commit c208472
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:pilll/entity/pill_sheet_type.dart';
import 'package:pilll/entity/setting.codegen.dart';
import 'package:pilll/entity/weekday.dart';
import 'package:pilll/provider/premium_and_trial.codegen.dart';
import 'package:pilll/util/datetime/day.dart';

class RecordPagePillSheet extends StatelessWidget {
final PillSheetGroup pillSheetGroup;
Expand All @@ -38,14 +39,13 @@ class RecordPagePillSheet extends StatelessWidget {

@override
Widget build(BuildContext context) {
final weekdayDate = pillSheet.beginingDate.add(Duration(
days: summarizedRestDuration(
restDurations: pillSheet.restDurations, upperDate: today())));

return PillSheetViewLayout(
weekdayLines: PillSheetViewWeekdayLine(
firstWeekday: WeekdayFunctions.weekdayFromDate(
pillSheet.restDurations
.lastWhereOrNull((element) => element.endDate != null)
?.endDate ??
pillSheet.beginingDate,
),
firstWeekday: WeekdayFunctions.weekdayFromDate(weekdayDate),
),
pillMarkLines: List.generate(
pillSheet.pillSheetType.numberOfLineInPillSheet,
Expand Down

0 comments on commit c208472

Please sign in to comment.