aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@xbmc.org>2014-01-04 16:19:03 +1300
committerJonathan Marshall <jmarshall@xbmc.org>2014-01-04 16:19:03 +1300
commit1c2e39c2edd8ee37492e697e1af0c3d244fcce71 (patch)
treeac59baca97c670d7c8055b4e2365c88e31a626c1
parent190f2ea78f460317f6723035c14b7cca26b1199a (diff)
[date/time] have SetFromDateString() first attempt SetFromDBDate() before attempting to parse for a 'Sunday, April 15 2006' style date
-rw-r--r--xbmc/XBDateTime.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp
index 8525691fea..995f9b7ded 100644
--- a/xbmc/XBDateTime.cpp
+++ b/xbmc/XBDateTime.cpp
@@ -696,6 +696,9 @@ bool CDateTime::SetFromDateString(const CStdString &date)
return false;
}
+ if (SetFromDBDate(date))
+ return true;
+
const char* months[] = {"january","february","march","april","may","june","july","august","september","october","november","december",NULL};
int j=0;
size_t iDayPos = date.find("day");
@@ -709,8 +712,8 @@ bool CDateTime::SetFromDateString(const CStdString &date)
iDayPos = 0;
CStdString strMonth = date.substr(iDayPos, iPos - iDayPos);
- if (strMonth.empty()) // assume dbdate format
- return SetFromDBDate(date);
+ if (strMonth.empty())
+ return false;
size_t iPos2 = date.find(",");
CStdString strDay = (date.size() >= iPos) ? date.substr(iPos, iPos2-iPos) : "";