Commit dbae156f authored by Bryce Johnson's avatar Bryce Johnson

Organize and comment time tracking computed values.

parent 6b922831
...@@ -67,16 +67,7 @@ function getRandomInt(min, max) { ...@@ -67,16 +67,7 @@ function getRandomInt(min, max) {
} }
}, },
computed: { computed: {
parsedEstimate() { /* Select panels to show */
return this.parseSeconds(this.time_estimate);
},
parsedSpent() {
return this.parseSeconds(this.time_spent);
},
parsedRemaining() {
const diffSeconds = this.time_estimate - this.time_spent;
return this.parseSeconds(diffSeconds);
},
showComparison() { showComparison() {
return !!this.time_estimate && !!this.time_spent; return !!this.time_estimate && !!this.time_spent;
}, },
...@@ -92,6 +83,18 @@ function getRandomInt(min, max) { ...@@ -92,6 +83,18 @@ function getRandomInt(min, max) {
showHelp() { showHelp() {
return !!this.displayHelp; return !!this.displayHelp;
}, },
/* Parsed time values */
parsedEstimate() {
return this.parseSeconds(this.time_estimate);
},
parsedSpent() {
return this.parseSeconds(this.time_spent);
},
parsedRemaining() {
const diffSeconds = this.time_estimate - this.time_spent;
return this.parseSeconds(diffSeconds);
},
/* Human readable time values */
estimatedPretty() { estimatedPretty() {
return this.stringifyTime(this.parsedEstimate); return this.stringifyTime(this.parsedEstimate);
}, },
...@@ -105,6 +108,7 @@ function getRandomInt(min, max) { ...@@ -105,6 +108,7 @@ function getRandomInt(min, max) {
const prefix = this.diffMinutes < 0 ? 'Over by' : 'Time remaining:'; const prefix = this.diffMinutes < 0 ? 'Over by' : 'Time remaining:';
return `${prefix} ${this.remainingPretty}`; return `${prefix} ${this.remainingPretty}`;
}, },
/* Diff values for comparison meter */
diffMinutes () { diffMinutes () {
const time_estimate = this.time_estimate; const time_estimate = this.time_estimate;
const time_spent = this.time_spent; const time_spent = this.time_spent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment