Kuma/src/components/Datetime.vue
Louis Lam b1465c0282 - Maintenance standardize datetime format to YYYY-MM-DD hh:mm:ss
- Import dayjs extensions one time only
- Maintenance activeCondition centralize
2022-09-28 00:20:17 +08:00

32 lines
632 B
Vue

<template>
<span>{{ displayText }}</span>
</template>
<script>
import dayjs from "dayjs";
export default {
props: {
/** Value of date time */
value: {
type: String,
default: null,
},
/** Should only the date be displayed? */
dateOnly: {
type: Boolean,
default: false,
},
},
computed: {
displayText() {
if (this.dateOnly) {
return this.$root.date(this.value);
} else {
return this.$root.datetime(this.value);
}
},
},
};
</script>