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