This commit is contained in:
@@ -73,8 +73,8 @@ export default {
|
||||
formats: {
|
||||
decimalSeparator: ".",
|
||||
currencySymbol: "$",
|
||||
shortDateFormat: "YYYY-MM-DD",
|
||||
shortTimeFormat: "hh:mm:ss A",
|
||||
shortDateAndTimeFormat: "YYYY-MM-DD hh:mm:ss A"
|
||||
shortDate: "YYYY-MM-DD",
|
||||
shortTime: "hh:mm:ss A",
|
||||
shortDateAndTime: "YYYY-MM-DD hh:mm:ss A"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -50,7 +50,13 @@
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker label="Start" :dayjs="this.dayjsLib" :locale="this.lc" v-model="obj.startDate"></gz-date-time-picker>
|
||||
<gz-date-time-picker
|
||||
label="Start"
|
||||
:dayjs="this.dayjsLib"
|
||||
:locale="this.lc"
|
||||
v-model="obj.startDate"
|
||||
|
||||
></gz-date-time-picker>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
|
||||
Reference in New Issue
Block a user