Actually fix the time formatting

This commit is contained in:
Torjus Håkestad 2021-04-10 13:57:18 +02:00
parent b6a6f45f45
commit 9eaeb21867

View File

@ -12,12 +12,6 @@ import { Component, Prop, Vue } from 'vue-property-decorator';
import { BvTableFieldArray, BvTableFormatterCallback } from 'bootstrap-vue'; import { BvTableFieldArray, BvTableFormatterCallback } from 'bootstrap-vue';
import { LoginAttempt } from '@/apiary/apiary'; import { LoginAttempt } from '@/apiary/apiary';
const timeFormatter: BvTableFormatterCallback = (value: string): string => {
const d = new Date(value);
const s = `${d.getUTCHours}:${d.getUTCMinutes}:${d.getUTCSeconds}`;
return s;
};
@Component @Component
export default class AttemptList extends Vue { export default class AttemptList extends Vue {
@Prop() private items!: LoginAttempt[]; @Prop() private items!: LoginAttempt[];
@ -28,7 +22,10 @@ export default class AttemptList extends Vue {
{ {
key: 'date', key: 'date',
sortable: true, sortable: true,
formatter: timeFormatter, formatter: (value: string): string => {
const d = new Date(value);
return `${d.getUTCHours()}:${d.getUTCMinutes()}:${d.getUTCSeconds()}`;
},
sortByFormatted: false, sortByFormatted: false,
}, },
{ {