From 9eaeb218670bae6e3efe1268bfbe8c6a11f873b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sat, 10 Apr 2021 13:57:18 +0200 Subject: [PATCH] Actually fix the time formatting --- web/frontend/src/components/AttemptList.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/frontend/src/components/AttemptList.vue b/web/frontend/src/components/AttemptList.vue index 6a32655..3598162 100644 --- a/web/frontend/src/components/AttemptList.vue +++ b/web/frontend/src/components/AttemptList.vue @@ -12,12 +12,6 @@ import { Component, Prop, Vue } from 'vue-property-decorator'; import { BvTableFieldArray, BvTableFormatterCallback } from 'bootstrap-vue'; 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 export default class AttemptList extends Vue { @Prop() private items!: LoginAttempt[]; @@ -28,7 +22,10 @@ export default class AttemptList extends Vue { { key: 'date', sortable: true, - formatter: timeFormatter, + formatter: (value: string): string => { + const d = new Date(value); + return `${d.getUTCHours()}:${d.getUTCMinutes()}:${d.getUTCSeconds()}`; + }, sortByFormatted: false, }, {