aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmllocale.cpp7
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp3
2 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index fc9e2fc42a..178280b27c 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -290,8 +290,11 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleTimeString(QV4::CallConte
tm = r->locale.toTime(dateString, enumFormat);
}
- QDateTime dt = QDateTime::currentDateTime();
- dt.setTime(tm);
+ QDateTime dt;
+ if (tm.isValid()) {
+ dt = QDateTime::currentDateTime();
+ dt.setTime(tm);
+ }
return QV4::Encode(engine->newDateObject(dt));
}
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
index 0eb38d92e6..9653cac988 100644
--- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
+++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
@@ -932,7 +932,6 @@ void tst_qqmllocale::dateFromLocaleString_data()
void tst_qqmllocale::dateFromLocaleString()
{
- QSKIP("Needs fixes in our date time parser");
QFETCH(QString, locale);
QFETCH(QString, format);
@@ -977,7 +976,6 @@ void tst_qqmllocale::dateFromLocaleDateString_data()
void tst_qqmllocale::dateFromLocaleDateString()
{
- QSKIP("Needs fixes in our date time parser");
QFETCH(QString, locale);
QFETCH(QString, format);
@@ -1022,7 +1020,6 @@ void tst_qqmllocale::dateFromLocaleTimeString_data()
void tst_qqmllocale::dateFromLocaleTimeString()
{
- QSKIP("Needs fixes in our date time parser");
QFETCH(QString, locale);
QFETCH(QString, format);