inline bool checkDate()

in cpp-ch/local-engine/Storages/Serializations/ExcelReadHelpers.h [32:44]


inline bool checkDate(const UInt16 & year, const UInt8 & month_, const UInt8 & day_)
{
    auto is_leap_year_ = (year % 400 == 0) || (year % 100 != 0 && year % 4 == 0);

    if ((month_ == 1 || month_ == 3 || month_ == 5 || month_ == 7 || month_ == 8 || month_ == 10 || month_ == 12) && day_ >= 1
        && day_ <= 31)
        return true;
    else if (month_ == 2 && ((is_leap_year_ && day_ >= 1 && day_ <= 29) || (!is_leap_year_ && day_ >= 1 && day_ <= 28)))
        return true;
    else if ((month_ == 4 || month_ == 6 || month_ == 9 || month_ == 11) && day_ >= 1 && day_ <= 30)
        return true;
    return false;
}