This commit is contained in:
Robert Vokac 2024-03-23 08:20:02 +01:00
parent 888e4b2cbc
commit 2f7482536e
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055

View File

@ -66,6 +66,7 @@ public class Time extends Thread {
public Calendar asCalendar() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, returnValueAsNeeded(yearProperty, yearCustomProperty));
cal.set(Calendar.MONTH, returnValueAsNeeded(monthProperty, monthCustomProperty) - 1);
cal.set(Calendar.DAY_OF_MONTH, returnValueAsNeeded(dayProperty, dayCustomProperty));
@ -80,6 +81,9 @@ public class Time extends Thread {
}
private int returnValueAsNeeded(int i1, int i2) {
if(this.allowCustomValuesProperty.isDisabled()) {
return i1;
}
return i2 == Integer.MAX_VALUE ? i1 : i2;
}