arnowelzel / periodical

A calendar to track your menstruation and calculate possible fertile days
http://arnowelzel.de/wp/en/projects/periodical
GNU General Public License v3.0
118 stars 43 forks source link

Predicted days one day shifted compared to future periodes #92

Closed mgth closed 1 year ago

mgth commented 1 year ago

I'm not sure I understand correctly but the actual fertile days and ovulation seams to be one day off compared to future estimation. I think dayofcycle may be incremented to soon, or should be used instead of day in type calculation.

                            for (int day = dayofcycle; day < length; day++) {
                                datePrevious.add(GregorianCalendar.DATE, 1);
                                dayofcycle++;

                                int type;

                                if (day == ovulationday) {
                                    // Day of ovulation
                                    type = DayEntry.OVULATION_PREDICTED;
                                } else if (day >= this.cycleShortest - luteallength - 4
                                        && day <= this.cycleLongest - luteallength + 3) {
                                    // Fertile days
                                    type = DayEntry.FERTILITY_PREDICTED;
                                } else {
                                    // Infertile days
                                    type = DayEntry.INFERTILE_PREDICTED;
                                }