Commit 54e62874 authored by Filipa Lacerda's avatar Filipa Lacerda

Improvements after review

parent edc97c9d
......@@ -23,6 +23,7 @@
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList.timeagoInstance = new timeago(); // eslint-disable-line
gl.environmentsList.EnvironmentItem = Vue.component('environment-item', {
......@@ -147,10 +148,15 @@
this.model.last_deployment.deployable;
},
/**
* Verifies if the date to be shown is present.
*
* @returns {Boolean|Undefined}
*/
canShowDate() {
return this.model.last_deployment &&
this.model.last_deployment.deployable &&
this.model.last_deployment.deployable.created_at;
this.model.last_deployment.deployable !== undefined;
},
/**
......@@ -159,9 +165,9 @@
* @returns {String}
*/
createdDate() {
const timeagoInstance = new timeago(); // eslint-disable-line
return timeagoInstance.format(this.model.last_deployment.deployable.created_at);
return window.gl.environmentsList.timeagoInstance.format(
this.model.last_deployment.deployable.created_at
);
},
/**
......
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