diff --git a/src/views/MyQueries.vue b/src/views/MyQueries.vue index 8c9a14c..c7fa56c 100644 --- a/src/views/MyQueries.vue +++ b/src/views/MyQueries.vue @@ -34,7 +34,7 @@
-
{{ query.createdAt }}
+
{{ query.createdAt | date }}
@@ -78,6 +78,21 @@ export default { new ResizeObserver(this.calcNameWidth).observe(this.$refs.table) this.calcNameWidth() }, + filters: { + date (value) { + if (!value) { + return '' + } + const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' } + const timeOptions = { + hour12: false, + hour: '2-digit', + minute: '2-digit' + } + return new Date(value).toLocaleDateString('en-GB', dateOptions) + ' ' + + new Date(value).toLocaleTimeString('en-GB', timeOptions) + } + }, methods: { calcNameWidth () { this.$refs['name-th'].style = `width: ${this.$refs['name-td'][0].offsetWidth}px`