nextDay method
Implementation
Solar nextDay(int days) {
int y = _year;
int m = _month;
int d = _day;
if (1582 == y && 10 == m) {
if (d > 4) {
d -= 10;
}
}
if (days > 0) {
d += days;
int daysInMonth = SolarUtil.getDaysOfMonth(y, m);
while (d > daysInMonth) {
d -= daysInMonth;
m++;
if (m > 12) {
m = 1;
y++;
}
daysInMonth = SolarUtil.getDaysOfMonth(y, m);
}
} else if (days < 0) {
while (d + days <= 0) {
m--;
if (m < 1) {
m = 12;
y--;
}
d += SolarUtil.getDaysOfMonth(y, m);
}
d += days;
}
if (1582 == y && 10 == m) {
if (d > 4) {
d += 10;
}
}
return Solar.fromYmdHms(y, m, d, _hour, _minute, _second);
}