Fix time formatting
This commit is contained in:
parent
38ef748dd0
commit
b43193cfbb
@ -9,23 +9,24 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
import { BvTableFieldArray } from 'bootstrap-vue';
|
||||
import { BvTableFieldArray, BvTableFormatterCallback } from 'bootstrap-vue';
|
||||
import { LoginAttempt } from '@/apiary/apiary';
|
||||
|
||||
const timeFormatter: BvTableFormatterCallback = (value: string) => {
|
||||
const d = new Date(value);
|
||||
return `${d.getUTCHours}:${d.getUTCMinutes}:${d.getUTCSeconds}`;
|
||||
};
|
||||
|
||||
@Component
|
||||
export default class AttemptList extends Vue {
|
||||
@Prop() private items!: LoginAttempt[];
|
||||
|
||||
attempts: LoginAttempt[];
|
||||
|
||||
fields: BvTableFieldArray = [
|
||||
{
|
||||
key: 'date',
|
||||
sortable: true,
|
||||
formatter: (value: string): string => {
|
||||
const d = new Date(value);
|
||||
return `${d.getUTCHours}:${d.getUTCMinutes}:${d.getUTCSeconds}`;
|
||||
},
|
||||
formatter: timeFormatter,
|
||||
sortByFormatted: false,
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user