debian-mirror-gitlab/app/assets/javascripts/vue_shared/mixins/timeago.js
2020-01-01 13:55:28 +05:30

18 lines
350 B
JavaScript

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