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>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import timeagoMixin from '~/vue_shared/mixins/timeago';
import { formatTime } from '~/lib/utils/datetime_utility';
export default {
directives: {
......@@ -27,7 +26,24 @@ export default {
return this.finishedTime !== '';
},
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