2017-12-07 11:09:17 +00:00
|
|
|
import { formatDate, getTimeago } from '../../lib/utils/datetime_utility';
|
2017-05-26 17:31:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mixin with time ago methods used in some vue components
|
|
|
|
*/
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
timeFormated(time) {
|
2017-12-07 11:09:17 +00:00
|
|
|
const timeago = getTimeago();
|
2017-05-26 17:31:16 +00:00
|
|
|
|
|
|
|
return timeago.format(time);
|
|
|
|
},
|
|
|
|
|
|
|
|
tooltipTitle(time) {
|
2017-12-07 11:09:17 +00:00
|
|
|
return formatDate(time);
|
2017-05-26 17:31:16 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|