diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 1e1a9962f8..6a9d1fbc69 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1461,15 +1461,13 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const case MinuteSection: case Hour24Section: case Hour12Section: - case YearSection: case YearSection2Digits: + ret |= AllowPartial; + Q_FALLTHROUGH(); + case YearSection: ret |= Numeric; - if (sn.type != YearSection) { - ret |= AllowPartial; - } - if (sn.count != 1) { + if (sn.count != 1) ret |= FixedWidth; - } break; case MonthSection: case DaySection: