diff --git a/js/ui/drawing-tools.js b/js/ui/drawing-tools.js index a743357..db4baa3 100644 --- a/js/ui/drawing-tools.js +++ b/js/ui/drawing-tools.js @@ -658,9 +658,17 @@ export class DrawingManager { // Time duration const diffSec = Math.abs(d.p2.time - d.p1.time); - const h = Math.floor(diffSec / 3600); - const m = Math.floor((diffSec % 3600) / 60); - const timeStr = `${h}h${m > 0 ? ` ${m}m` : ''}`; + let timeStr = ""; + if (diffSec >= 86400) { + const days = Math.floor(diffSec / 86400); + const hours = Math.floor((diffSec % 86400) / 3600); + const mins = Math.floor((diffSec % 3600) / 60); + timeStr = `${days}d${hours > 0 ? ` ${hours}h` : ''}${mins > 0 ? ` ${mins}m` : ''}`; + } else { + const hours = Math.floor(diffSec / 3600); + const mins = Math.floor((diffSec % 3600) / 60); + timeStr = `${hours}h${mins > 0 ? ` ${mins}m` : ''}`; + } const volStr = totalVol > 1000 ? `${(totalVol/1000).toFixed(3)}K` : totalVol.toFixed(0);