Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#813 Time taken (instead of duration) #836

Merged
merged 1 commit into from
Sep 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
Test details
</h2>

<dl class="govuk-summary-list">
<dl
v-if="response"
class="govuk-summary-list"
>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Status
Expand Down Expand Up @@ -45,10 +48,10 @@
class="govuk-summary-list__row"
>
<dt class="govuk-summary-list__key">
Duration
Time taken
</dt>
<dd class="govuk-summary-list__value">
{{ response.duration.testDurationAdjusted }} minutes
{{ timeTaken }}
</dd>
</div>
<div class="govuk-summary-list__row">
Expand All @@ -62,10 +65,10 @@
<table class="govuk-table">
<tr class="govuk-table__row">
<td class="govuk-table__cell">
Duration
Duration / Adjusted
</td>
<td class="govuk-table__cell">
{{ response.duration.testDuration }} minutes
{{ response.duration.testDuration }} min. / {{ response.duration.testDurationAdjusted }} min.
</td>
</tr>
<tr class="govuk-table__row">
Expand Down Expand Up @@ -183,6 +186,18 @@ export default {
}
return label;
},
timeTaken() {
let diff = 0;
if (this.response.statusLog.completed && this.response.statusLog.started) {
diff = this.response.statusLog.completed - this.response.statusLog.started;
}
const newDate = new Date(diff);
const hh = `0${newDate.getUTCHours()}`.slice(-2);
const mm = `0${newDate.getUTCMinutes()}`.slice(-2);
const ss = `0${newDate.getUTCSeconds()}`.slice(-2);
const returnTimeTaken = `${hh}:${mm}:${ss}`;
return returnTimeTaken;
},
},
async created() {
this.$store.dispatch('qualifyingTestResponses/bindRecord', { id: this.responseId });
Expand Down