Skip to content

Commit d5c75c7

Browse files
authored
Merge pull request #2 from demosdemon/hours
Display the running time
2 parents ef23c9c + 4de4068 commit d5c75c7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
* Update the libraries
77
* Add the list of contributors in the Play view
88
* Fix the vulnerability introduced by the concurrently package (lodash old version)
9+
10+
## v0.0.1-alpha.12
11+
* Format running time to include hours instead of just minutes

gui/react/src/components/Play.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ class Play extends Component {
327327

328328
const instanceTypeCell = config.AWSInstanceType;
329329

330-
const runningCell = this.state.cloudRIGState.runningTime ? this.state.cloudRIGState.runningTime + " mins" : "-";
330+
let runningCell = "-";
331+
if (this.state.cloudRIGState.runningTime) {
332+
const runningHours = Math.floor(this.state.cloudRIGState.runningTime / 60);
333+
const runningMinutes = this.state.cloudRIGState.runningTime % 60;
334+
runningCell = runningHours > 0 ? `${runningHours}h ${runningMinutes} mins` : `${runningMinutes} mins`;
335+
}
331336

332337
const remainingCell = this.state.cloudRIGState.scheduledStop
333338
? this.state.cloudRIGState.remainingTime + " mins"

0 commit comments

Comments
 (0)