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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
precambrien opened this issue May 17, 2021 · 1 comment
8000
Open

Comments

@precambrien
Copy link
Contributor

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.

@precambrien
Copy link
Contributor Author

I made a PR for this issue (#13)
commit a06561f :
a06561f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0