2021-06-30 13:04:58 +00:00
|
|
|
<template>
|
|
|
|
<span>{{ displayText }}</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2022-06-02 14:15:21 +00:00
|
|
|
/** Value of date time */
|
2022-04-30 01:51:14 +00:00
|
|
|
value: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
2022-06-01 23:32:05 +00:00
|
|
|
/** Should only the date be displayed? */
|
2021-07-26 14:53:07 +00:00
|
|
|
dateOnly: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
displayText() {
|
2021-08-17 08:41:12 +00:00
|
|
|
if (this.dateOnly) {
|
|
|
|
return this.$root.date(this.value);
|
|
|
|
} else {
|
|
|
|
return this.$root.datetime(this.value);
|
2021-07-26 14:53:07 +00:00
|
|
|
}
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
2021-07-27 17:47:13 +00:00
|
|
|
},
|
2022-04-13 16:30:32 +00:00
|
|
|
};
|
2021-06-30 13:04:58 +00:00
|
|
|
</script>
|