mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-19 04:34:33 -05:00
31 lines
611 B
Vue
31 lines
611 B
Vue
<template>
|
|
<span>{{ displayText }}</span>
|
|
</template>
|
|
|
|
<script>
|
|
import dayjs from "dayjs";
|
|
import relativeTime from "dayjs/plugin/relativeTime"
|
|
import utc from 'dayjs/plugin/utc'
|
|
import timezone from 'dayjs/plugin/timezone' // dependent on utc plugin
|
|
dayjs.extend(utc)
|
|
dayjs.extend(timezone)
|
|
dayjs.extend(relativeTime)
|
|
|
|
export default {
|
|
props: {
|
|
value: String,
|
|
},
|
|
|
|
computed: {
|
|
displayText() {
|
|
let format = "YYYY-MM-DD HH:mm:ss";
|
|
return dayjs.utc(this.value).tz(this.$root.timezone).format(format)
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|