diff --git a/ui/src/Utils/time.js b/ui/src/Utils/time.js
index 248738e..c5efa65 100644
--- a/ui/src/Utils/time.js
+++ b/ui/src/Utils/time.js
@@ -10,11 +10,13 @@ function toTimeStr(diff) {
return `${hoursStr}:${minutesStr}:${secondsStr}`;
}
-export function timeBetweenAsString({endTime=null, startTime=null}) {
+export function timeBetweenAsString({endTime=null, startTime=null, bounded=false}) {
if (null === startTime) startTime = new Date();
if (null === endTime) endTime = new Date();
- const diff = endTime - startTime; // in ms
+ let diff = endTime - startTime; // in ms
+ if (bounded && (diff < 0)) diff = 0;
+
if (diff < 0) return '-' + toTimeStr(-diff);
return toTimeStr(diff);
}
\ No newline at end of file
diff --git a/ui/src/components/CurrentOperationInfoArea.js b/ui/src/components/CurrentOperationInfoArea.js
index b4ed46c..016fb18 100644
--- a/ui/src/components/CurrentOperationInfoArea.js
+++ b/ui/src/components/CurrentOperationInfoArea.js
@@ -5,7 +5,7 @@ import TimerArea from "./TimerArea";
export function CurrentOperationInfoAreaComponent({
isRunning, estimatedEndTime
}) {
- if (!isRunning) return null;
+ estimatedEndTime = isRunning ? estimatedEndTime : null;
return (
diff --git a/ui/src/components/SystemControls.js b/ui/src/components/SystemControls.js
index 16d1a8a..b98b6e5 100644
--- a/ui/src/components/SystemControls.js
+++ b/ui/src/components/SystemControls.js
@@ -1,6 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
-import { Button } from 'react-bootstrap';
+import { Button, Container } from 'react-bootstrap';
import { useWaterPumpAPI } from '../contexts/WaterPumpAPIContext';
import { startPump, stopPump } from '../store/slices/SystemStatus.js';
@@ -19,14 +19,14 @@ export function SystemControlsComponent({
const isRunning = systemStatus.pump.running;
return (
- <>
-