MCPcopy Create free account
hub / github.com/bytedance/bolt / isValidDate

Function isValidDate

bolt/type/TimestampConversion.cpp:614–625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614bool 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
627bool isValidDayOfYear(int32_t year, int32_t dayOfYear) {
628 if (year < kMinYear || year > kMaxYear) {

Callers 2

parseMethod · 0.85
daysSinceEpochFromDateFunction · 0.85

Calls 1

isLeapYearFunction · 0.85

Tested by

no test coverage detected