summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index a9d3095224..7561847c96 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -408,8 +408,6 @@ int QDate::daysInMonth() const
getDateFromJulianDay(jd, &y, &m, 0);
if (m == 2 && isLeapYear(y))
return 29;
- else if (m < 1 || m > 12)
- return 0;
else
return monthDays[m];
}
@@ -1150,9 +1148,10 @@ QDate QDate::fromString(const QString& s, Qt::DateFormat f)
break;
}
}
- }
- if (month < 1 || month > 12) {
- return QDate();
+ if (month == -1) {
+ // Month name matches neither English nor other localised name.
+ return QDate();
+ }
}
bool ok;