Commit 0380fdb4 authored by Regis's avatar Regis

cache timeAgo object

parent 0dcd30b4
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
'pipeline', 'pipeline',
], ],
computed: { computed: {
timeAgo() {
return gl.utils.getTimeago();
},
localTimeFinished() { localTimeFinished() {
return gl.utils.formatDate(this.pipeline.details.finished_at); return gl.utils.formatDate(this.pipeline.details.finished_at);
}, },
...@@ -25,7 +28,7 @@ ...@@ -25,7 +28,7 @@
options.timeZoneName = 'short'; options.timeZoneName = 'short';
const finished = this.pipeline.details.finished_at; const finished = this.pipeline.details.finished_at;
if (!finished && changeTime) return false; if (!finished && changeTime) return false;
return ({ words: gl.utils.getTimeago().format(finished) }); return ({ words: this.timeAgo.format(finished) });
}, },
}, },
methods: { methods: {
......
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