This commit is contained in:
Robert Vokac 2024-03-23 08:20:06 +01:00
parent e56d7cf00c
commit c9692719bb
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055

View File

@ -92,14 +92,14 @@ public class Progress {
cal.set(Calendar.MILLISECOND, millisecond);
int daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
if(month == 1) {
return (daysInMonth * monthProgress + totalCountOfDaysInAYear - daysInMonth) / totalCountOfDaysInAYear;
return (daysInMonth * monthProgress) / totalCountOfDaysInAYear;
} else {
cal.set(Calendar.MONTH, month - 2);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
int totalDaysUntilLastDayOfLastMonth = cal.get(Calendar.DAY_OF_YEAR);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.DAY_OF_MONTH, day);
return (totalDaysUntilLastDayOfLastMonth + (daysInMonth * monthProgress) + (totalCountOfDaysInAYear - totalDaysUntilLastDayOfLastMonth - daysInMonth))/totalCountOfDaysInAYear;
return (totalDaysUntilLastDayOfLastMonth + (daysInMonth * monthProgress)) / totalCountOfDaysInAYear;
}
}