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: 61e45fa5195592cf6161bc66fe8c4fdaa4189990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { formatDate, getTimeago, timeagoLanguageCode } from '~/lib/utils/datetime_utility';

/**
 * Mixin with time ago methods used in some vue components
 */
export default {
  methods: {
    timeFormatted(time, format) {
      const timeago = getTimeago(format);

      return timeago.format(time, timeagoLanguageCode);
    },

    tooltipTitle(time) {
      return formatDate(time);
    },
  },
};