mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
patch14
This commit is contained in:
parent
888e4b2cbc
commit
2f7482536e
@ -66,6 +66,7 @@ public class Time extends Thread {
|
|||||||
|
|
||||||
public Calendar asCalendar() {
|
public Calendar asCalendar() {
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
|
|
||||||
cal.set(Calendar.YEAR, returnValueAsNeeded(yearProperty, yearCustomProperty));
|
cal.set(Calendar.YEAR, returnValueAsNeeded(yearProperty, yearCustomProperty));
|
||||||
cal.set(Calendar.MONTH, returnValueAsNeeded(monthProperty, monthCustomProperty) - 1);
|
cal.set(Calendar.MONTH, returnValueAsNeeded(monthProperty, monthCustomProperty) - 1);
|
||||||
cal.set(Calendar.DAY_OF_MONTH, returnValueAsNeeded(dayProperty, dayCustomProperty));
|
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) {
|
private int returnValueAsNeeded(int i1, int i2) {
|
||||||
|
if(this.allowCustomValuesProperty.isDisabled()) {
|
||||||
|
return i1;
|
||||||
|
}
|
||||||
return i2 == Integer.MAX_VALUE ? i1 : i2;
|
return i2 == Integer.MAX_VALUE ? i1 : i2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user