debian-mirror-gitlab/app/assets/javascripts/admin/users/components/user_date.vue
2021-03-11 19:13:27 +05:30

29 lines
545 B
Vue

<script>
import { formatDate } from '~/lib/utils/datetime_utility';
import { __ } from '~/locale';
import { SHORT_DATE_FORMAT } from '../constants';
export default {
props: {
date: {
type: String,
required: false,
default: null,
},
},
computed: {
formattedDate() {
const { date } = this;
if (date === null) {
return __('Never');
}
return formatDate(new Date(date), SHORT_DATE_FORMAT);
},
},
};
</script>
<template>
<span>
{{ formattedDate }}
</span>
</template>