Commit 7645d63d authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'mw-fix-pipeline-duration' into 'master'

Fix regression in durationFormatted

See merge request gitlab-org/gitlab!46706
parents 1609ebec 0cf83903
<script> <script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import { formatTime } from '~/lib/utils/datetime_utility';
export default { export default {
directives: { directives: {
...@@ -27,7 +26,24 @@ export default { ...@@ -27,7 +26,24 @@ export default {
return this.finishedTime !== ''; return this.finishedTime !== '';
}, },
durationFormatted() { durationFormatted() {
return formatTime(this.duration); const date = new Date(this.duration * 1000);
let hh = date.getUTCHours();
let mm = date.getUTCMinutes();
let ss = date.getSeconds();
// left pad
if (hh < 10) {
hh = `0${hh}`;
}
if (mm < 10) {
mm = `0${mm}`;
}
if (ss < 10) {
ss = `0${ss}`;
}
return `${hh}:${mm}:${ss}`;
}, },
}, },
}; };
......
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