Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-28 00:10:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-28 00:10:09 +0300
commita28eb91c64e50623d3614892db798656ee7d83ca (patch)
tree1ef941dbd80704bc6ecc44a4635c1b06bfac8fb1 /app/assets/javascripts/vue_shared/mixins
parentc3f28c9b07a4eb35fecd351e2d7b51212b6c2342 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/mixins')
-rw-r--r--app/assets/javascripts/vue_shared/mixins/timeago.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/mixins/timeago.js b/app/assets/javascripts/vue_shared/mixins/timeago.js
index af14c6d9486..45452f2ea35 100644
--- a/app/assets/javascripts/vue_shared/mixins/timeago.js
+++ b/app/assets/javascripts/vue_shared/mixins/timeago.js
@@ -14,5 +14,25 @@ export default {
tooltipTitle(time) {
return formatDate(time);
},
+
+ durationTimeFormatted(duration) {
+ const date = new Date(duration * 1000);
+
+ let hh = date.getUTCHours();
+ let mm = date.getUTCMinutes();
+ let ss = date.getSeconds();
+
+ if (hh < 10) {
+ hh = `0${hh}`;
+ }
+ if (mm < 10) {
+ mm = `0${mm}`;
+ }
+ if (ss < 10) {
+ ss = `0${ss}`;
+ }
+
+ return `${hh}:${mm}:${ss}`;
+ },
},
};