This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-layout row wrap>
|
||||
<v-layout row wrap v-if="!readonly">
|
||||
<v-flex xs6>
|
||||
<v-dialog v-model="modal" persistent lazy full-width width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
@@ -30,15 +30,17 @@
|
||||
</v-dialog>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<!-- <v-text-field
|
||||
v-else
|
||||
<v-text-field
|
||||
v-if="readonly"
|
||||
v-model="formatDateTime"
|
||||
v-bind:label="label"
|
||||
prepend-icon="fa-calendar-alt"
|
||||
disabled
|
||||
></v-text-field>-->
|
||||
></v-text-field>
|
||||
</div>
|
||||
</template> <script>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
data: () => ({ date: null, modal: false, modal2: false }),
|
||||
props: {
|
||||
@@ -58,15 +60,29 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
formatDateTime() {
|
||||
//console.log("FORMAT DATE TIME");
|
||||
//debugger;
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortDateAndTimeFormat)
|
||||
? this.dayjs(this.value).format(this.locale.formats.shortDateAndTime)
|
||||
: "";
|
||||
},
|
||||
formatDate() {
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortTimeFormat)
|
||||
? this.dayjs(this.value).format(this.locale.formats.shortDate)
|
||||
: "";
|
||||
},
|
||||
formatTime() {
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.formats.shortTime)
|
||||
: "";
|
||||
//Note in original code this would be parsed expecting source value to be in UTC format coming in but display in local time format
|
||||
//so
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
// }
|
||||
// return momentObj.local().format("h:mm a");
|
||||
},
|
||||
dateOnly: {
|
||||
get() {
|
||||
return this.value ? this.value.substr(0, 10) : null;
|
||||
@@ -87,18 +103,6 @@ export default {
|
||||
set(value) {
|
||||
this.date = this.dateOnly + " " + value;
|
||||
}
|
||||
},
|
||||
formatTime() {
|
||||
return this.value
|
||||
? this.dayjs(this.value).format(this.locale.shortTimeFormat)
|
||||
: "";
|
||||
//Note in original code this would be parsed expecting source value to be in UTC format coming in but display in local time format
|
||||
//so
|
||||
// let momentObj = this.$moment.utc();
|
||||
// if (this.value) {
|
||||
// momentObj = this.$moment.utc(this.value);
|
||||
// }
|
||||
// return momentObj.local().format("h:mm a");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user