2021-06-30 13:04:58 +00:00
|
|
|
<template>
|
|
|
|
<span>{{ displayText }}</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
import relativeTime from "dayjs/plugin/relativeTime"
|
2021-06-30 18:02:54 +00:00
|
|
|
import utc from 'dayjs/plugin/utc'
|
|
|
|
import timezone from 'dayjs/plugin/timezone' // dependent on utc plugin
|
|
|
|
dayjs.extend(utc)
|
|
|
|
dayjs.extend(timezone)
|
2021-06-30 13:04:58 +00:00
|
|
|
dayjs.extend(relativeTime)
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: String,
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
displayText() {
|
2021-07-01 13:47:14 +00:00
|
|
|
let format = "YYYY-MM-DD HH:mm:ss";
|
|
|
|
return dayjs.utc(this.value).tz(this.$root.timezone).format(format)
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
</style>
|