8000 Wrong cycleStart in calendar view if cycle is across 2 months · Issue #12 · wildeyedskies/log28 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Wrong cycleStart in calendar view if cycle is across 2 months #12
Open
@precambrien

Description

@precambrien

In the calendarView, the first cycle predicted for the next period is wrong if the initial period dates span across two months.
_20210517_031531
In this example, the cycle starts on 28/04 so the next cycle should start on 26/05 (using a 28 length default cycle).
I think the error is in predictFuturePeriods(...) in CalendarView.kt, l.106 :

var cycleStart = periodDates.filter { item -> item -1 !in periodDates }.max()?.toCalendar()

item is in long format so item -1 won't work for a cycle across two months. Here, cycleStart should be 20210328 but is 20210401 as item -1 (20210400) is not in periodDates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0