Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timeago.js « mixins « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c5f41d811673e7d4765cfc6625968f7b9bb29117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
    },
  },
};