Skip to content

event widget range bug #19

@jihanga

Description

@jihanga

If there is a date that ends on the last day of the week based on the calendar, the event widget is drawn for another week (for this screenshot, it's Saturday)

The _mapSimpleEventToDrawerOrNull function in the event_util.dart file determines the scope of the event widget, which seems to have caused a bug.
In this function, the code part below is the part that handles exceptions, but it does not appear to be properly handled.

if (jEnd.isBefore(begin, unit: Unit.day) ||
  jBegin.isAfter(end, unit: Unit.day)) {
  return null;
}

So as a temporary measure, I'll get rid of unit parameters

if (jEnd.isBefore(begin) ||
  jBegin.isAfter(end)) {
  return null;
}

If you make it into , the bug disappears.

Please check if the solution I solved is right.
If this is not a solution, I would like you to tell me the role of the unit parameter.

스크린샷 2023-06-20 오후 5 52 25 스크린샷 2023-06-20 오후 5 41 27 스크린샷 2023-06-20 오후 5 41 36

The three screenshots above are the screens with bugs.

The event widget exists until July 1, but the actual event only exists until June 24.

스크린샷 2023-06-20 오후 5 42 00

After fixing the code, the bug disappeared like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions