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
388 B
JavaScript
Raw Normal View History

2022-07-16 23:28:13 +05:30
import { formatDate, getTimeago, timeagoLanguageCode } 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
2022-07-16 23:28:13 +05:30
return timeago.format(time, timeagoLanguageCode);
2017-09-10 17:25:29 +05:30
},
tooltipTitle(time) {
2018-03-17 18:26:18 +05:30
return formatDate(time);
2017-09-10 17:25:29 +05:30
},
},
};