debian-mirror-gitlab/app/assets/javascripts/vue_shared/mixins/timeago.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
346 B
JavaScript
Raw Normal View History

2022-06-21 17:19:12 +05:30
import { formatDate, getTimeago } from '~/lib/utils/datetime_utility';
2017-09-10 17:25:29 +05:30
/**
* Mixin with time ago methods used in some vue components
*/
export default {
methods: {
2020-01-01 13:55:28 +05:30
timeFormatted(time) {
2018-03-17 18:26:18 +05:30
const timeago = getTimeago();
2017-09-10 17:25:29 +05:30
return timeago.format(time);
},
tooltipTitle(time) {
2018-03-17 18:26:18 +05:30
return formatDate(time);
2017-09-10 17:25:29 +05:30
},
},
};