Solar.fromYmdHms constructor
Implementation
Solar.fromYmdHms(int year, int month, int day, int hour, int minute, int second) {
if (1582 == year && 10 == month) {
if (day > 4 && day < 15) {
throw 'wrong solar year $year month $month day $day';
}
}
if (month < 1 || month > 12) {
throw 'wrong month $month';
}
if (day < 1) {
throw 'wrong day $day';
}
int days = SolarUtil.getDaysOfMonth(year, month);
if (day > days) {
throw 'only $days days in solar year $year month $month';
}
if (hour < 0 || hour > 23) {
throw 'wrong hour $hour';
}
if (minute < 0 || minute > 59) {
throw 'wrong minute $minute';
}
if (second < 0 || second > 59) {
throw 'wrong second $second';
}
_year = year;
_month = month;
_day = day;
_hour = hour;
_minute = minute;
_second = second;
}