From 771cf807de52c8b4352eed341c3cc40c35c9b9d2 Mon Sep 17 00:00:00 2001
From: Timo Jyrinki <timo.jyrinki@canonical.com>
Date: Thu, 3 Apr 2014 05:28:38 +0000
Subject: [PATCH] Support RFC2822Date date format similar to V8.

Currently a date like "Wed, 18 Sep 2013 07:00:51 -0700" cannot be parsed.
However, this used to work in Qt 5.0.2. This commit adds a check for
Qt::RFC2822Date format after the ISODate check but before the manually
defined QStringLiteral formats.

Task-Number: QTBUG-38011
---
 src/qml/jsruntime/qv4dateobject.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp
index fc94862..70bec14 100644
--- a/src/qml/jsruntime/qv4dateobject.cpp
+++ b/src/qml/jsruntime/qv4dateobject.cpp
@@ -488,6 +488,8 @@ static inline double ParseString(const QString &s)
     QDateTime dt = QDateTime::fromString(s, Qt::TextDate);
     if (!dt.isValid())
         dt = QDateTime::fromString(s, Qt::ISODate);
+    if (!dt.isValid())
+        dt = QDateTime::fromString(s, Qt::RFC2822Date);
     if (!dt.isValid()) {
         QStringList formats;
         formats << QStringLiteral("M/d/yyyy")
-- 
1.9.0

