Date string parser. Move statement

This commit is contained in:
Bjørn Erik Jensen 2017-10-03 11:12:45 +02:00
parent c68a96de30
commit 282d8ef080

View File

@ -107,10 +107,10 @@ bool RiaDateStringParser::tryParseDayFirst(const std::string& s, int& year, int&
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaDateStringParser::tryParseYear(const std::string& s, int &year) bool RiaDateStringParser::tryParseYear(const std::string& s, int &year)
{ {
auto today = QDate::currentDate();
if (containsAlphabetic(s)) return false; if (containsAlphabetic(s)) return false;
try try
{ {
auto today = QDate::currentDate();
int y = std::stoi(s); int y = std::stoi(s);
if (y > 1970 && y <= today.year()) if (y > 1970 && y <= today.year())
{ {