fix 'DateTimeEditComponent' output formatting.

If the display mode is `DISP_DATE`, ignore the `mTime` field when calculating the output.
This fixes the size calculation of the component.

Fixes https://github.com/RetroPie/EmulationStation/issues/385.
This commit is contained in:
Cristi Mitrana 2019-12-03 15:11:35 +02:00
parent d62758c7cf
commit c48c2ce56f

View file

@ -200,6 +200,8 @@ std::string DateTimeEditComponent::getDisplayString(DisplayMode mode) const
fmt = "%m/%d/%Y";
break;
case DISP_DATE_TIME:
if(mTime.getTime() == 0)
return "unknown";
fmt = "%m/%d/%Y %H:%M:%S";
break;
case DISP_RELATIVE_TO_NOW:
@ -227,9 +229,6 @@ std::string DateTimeEditComponent::getDisplayString(DisplayMode mode) const
break;
}
if(mTime.getTime() == 0)
return "unknown";
return Utils::Time::timeToString(mTime, fmt);
}