| 612 | } |
| 613 | |
| 614 | bool isValidDate(int32_t year, int32_t month, int32_t day) { |
| 615 | if (month < 1 || month > 12) { |
| 616 | return false; |
| 617 | } |
| 618 | if (year < kMinYear || year > kMaxYear) { |
| 619 | return false; |
| 620 | } |
| 621 | if (day < 1) { |
| 622 | return false; |
| 623 | } |
| 624 | return isLeapYear(year) ? day <= kLeapDays[month] : day <= kNormalDays[month]; |
| 625 | } |
| 626 | |
| 627 | bool isValidDayOfYear(int32_t year, int32_t dayOfYear) { |
| 628 | if (year < kMinYear || year > kMaxYear) { |
no test coverage detected