From 73f0b9dabdbfab03a8c43f8695d386c4bc903294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 18 Apr 2014 14:21:27 +0200 Subject: [PATCH] Always interpret negative duration as 0. Negative durations, especially for print time left, might arise if estimation is estimating less than current print time. So we just erase that margin of error in the UI. Closes #435 --- src/octoprint/static/js/app/helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/octoprint/static/js/app/helpers.js b/src/octoprint/static/js/app/helpers.js index a04072ae..fbee8834 100644 --- a/src/octoprint/static/js/app/helpers.js +++ b/src/octoprint/static/js/app/helpers.js @@ -293,6 +293,7 @@ function formatSize(bytes) { function formatDuration(seconds) { if (!seconds) return "-"; + if (seconds < 0) return "00:00:00"; var s = seconds % 60; var m = (seconds % 3600) / 60;