gitlab-org--gitlab-foss/app/assets/javascripts/vue_shared/mixins/timeago.js
2017-12-07 11:09:17 +00:00

18 lines
349 B
JavaScript

import { formatDate, getTimeago } from '../../lib/utils/datetime_utility';
/**
* Mixin with time ago methods used in some vue components
*/
export default {
methods: {
timeFormated(time) {
const timeago = getTimeago();
return timeago.format(time);
},
tooltipTitle(time) {
return formatDate(time);
},
},
};