diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index 79bcb8e9c..bc6cf482d 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -199,6 +199,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: @@ -226,9 +228,6 @@ std::string DateTimeEditComponent::getDisplayString(DisplayMode mode) const break; } - if(mTime.getTime() == 0) - return "unknown"; - return Utils::Time::timeToString(mTime, fmt); }