Merge pull request #621 from cmitu/date-fix

fix 'DateTimeEditComponent' output formatting
This commit is contained in:
Jools Wills 2019-12-10 05:31:49 +00:00 committed by GitHub
commit d1c24f429e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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