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");
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) : "";
return false;
// assumes format:
// YYYY-MM-DD or DD-MM-YYYY
+ const static std::string sep_chars = "-./";
int year = 0, month = 0, day = 0;
- if (date[2] == '-' || date[2] == '.')
+ if (sep_chars.find(date[2]) != std::string::npos)
{
day = atoi(date.substr(0, 2).c_str());
month = atoi(date.substr(3, 2).c_str());
year = atoi(date.substr(6, 4).c_str());
}
- else
+ else if (sep_chars.find(date[4]) != std::string::npos)
{
year = atoi(date.substr(0, 4).c_str());
month = atoi(date.substr(5, 2).c_str());