QDateTime - Remove incorrect year range check
The limit on formatting a year outside the range 0 to 9999 only applies to Qt::ISODate formatting, not to general date formatting. Change-Id: Ifc971961412c190d721f23627982283e13d526b6 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
35af88b37e
commit
8b02a62685
@ -960,17 +960,11 @@ QString QDate::toString(Qt::DateFormat f) const
|
||||
|
||||
If the datetime is invalid, an empty string will be returned.
|
||||
|
||||
\warning The Qt::ISODate format is only valid for years in the
|
||||
range 0 to 9999. This restriction may apply to locale-aware
|
||||
formats as well, depending on the locale settings.
|
||||
|
||||
\sa QDateTime::toString(), QTime::toString(), QLocale::toString()
|
||||
|
||||
*/
|
||||
QString QDate::toString(const QString& format) const
|
||||
{
|
||||
if (year() > 9999)
|
||||
return QString();
|
||||
return QLocale::system().toString(*this, format);
|
||||
}
|
||||
#endif //QT_NO_DATESTRING
|
||||
|
Loading…
Reference in New Issue
Block a user