Lunar.fromSolar constructor
Lunar.fromSolar(
- Solar solar
Implementation
Lunar.fromSolar(Solar solar) {
LunarYear ly = LunarYear.fromYear(solar.getYear());
for (LunarMonth m in ly.getMonths()) {
int days = solar.subtract(Solar.fromJulianDay(m.getFirstJulianDay()));
if (days < m.getDayCount()) {
_year = m.getYear();
_month = m.getMonth();
_day = days + 1;
break;
}
}
_hour = solar.getHour();
_minute = solar.getMinute();
_second = solar.getSecond();
_solar = solar;
_compute(ly);
}