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: 438da925937f8ac54b15c9c5b2feee4d0e32c4b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { getTimeago, localeDateFormat, 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 localeDateFormat.asDateTimeFull.format(time);
    },
  },
};