diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index fef38aa47..54b1b1011 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -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); }