This commit is contained in:
@@ -53,9 +53,7 @@ export default {
|
||||
props: {
|
||||
label: String,
|
||||
value: String,
|
||||
readonly: { type: Boolean, default: false },
|
||||
//dayjs: Function,
|
||||
locale: Object
|
||||
readonly: { type: Boolean, default: false }
|
||||
},
|
||||
watch: {
|
||||
date() {
|
||||
@@ -69,45 +67,45 @@ export default {
|
||||
formatDateTime() {
|
||||
return this.value
|
||||
? this.$dayjs(this.value)
|
||||
.add(this.locale.timeZoneOffset, "hour")
|
||||
.format(this.locale.formats.shortDateAndTime)
|
||||
.add(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.formats.shortDateAndTime)
|
||||
: "";
|
||||
},
|
||||
formatDate() {
|
||||
return this.value
|
||||
? this.$dayjs(this.value)
|
||||
.add(this.locale.timeZoneOffset, "hour")
|
||||
.format(this.locale.formats.shortDate)
|
||||
.add(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.formats.shortDate)
|
||||
: "";
|
||||
},
|
||||
formatTime() {
|
||||
return this.value
|
||||
? this.$dayjs(this.value)
|
||||
.add(this.locale.timeZoneOffset, "hour")
|
||||
.format(this.locale.formats.shortTime)
|
||||
.add(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.formats.shortTime)
|
||||
: "";
|
||||
},
|
||||
dateOnly: {
|
||||
get() {
|
||||
return this.$dayjs(this.value)
|
||||
.add(this.locale.timeZoneOffset, "hour")
|
||||
.add(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.format("YYYY-MM-DD");
|
||||
},
|
||||
set(value) {
|
||||
this.date = this.$dayjs(value + " " + this.timeOnly)
|
||||
.subtract(this.locale.timeZoneOffset, "hour")
|
||||
.subtract(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.toISOString();
|
||||
}
|
||||
},
|
||||
timeOnly: {
|
||||
get() {
|
||||
return this.$dayjs(this.value)
|
||||
.add(this.locale.timeZoneOffset, "hour")
|
||||
.add(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.format("HH:mm:ss");
|
||||
},
|
||||
set(value) {
|
||||
this.date = this.$dayjs(this.dateOnly + " " + value)
|
||||
.subtract(this.locale.timeZoneOffset, "hour")
|
||||
.subtract(this.$gzlocale.timeZoneOffset, "hour")
|
||||
.toISOString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker label="Start" :locale="this.$gzlocale" v-model="obj.startDate"></gz-date-time-picker>
|
||||
<gz-date-time-picker label="Start" 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