display '-' if elapse time is negative

This commit is contained in:
Jimmy Shih
2013-04-30 13:35:56 -07:00
parent 67fbb47639
commit 027ae7b2dd
@@ -85,10 +85,13 @@ public class StringUtils {
* level 17, it returns strings like "1:0:00" instead of "1:00:00", which * level 17, it returns strings like "1:0:00" instead of "1:00:00", which
* breaks several unit tests. * breaks several unit tests.
*/ */
long elapsedSeconds = time / 1000; if (time < 0) {
return "-";
}
long hours = 0; long hours = 0;
long minutes = 0; long minutes = 0;
long seconds = 0; long seconds = 0;
long elapsedSeconds = time / 1000;
if (elapsedSeconds >= 3600) { if (elapsedSeconds >= 3600) {
hours = elapsedSeconds / 3600; hours = elapsedSeconds / 3600;