This commit is contained in:
2019-05-29 22:37:01 +00:00
parent 4f4252a947
commit 871a5da022
7 changed files with 78 additions and 48 deletions

View File

@@ -101,37 +101,37 @@ export default {
return this.value
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortDateAndTime)
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format(this.$gzlocale.format().shortDateAndTime)
: "";
},
formatDate() {
return this.value
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortDate)
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format(this.$gzlocale.format().shortDate)
: "";
},
formatTime() {
return this.value
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortTime)
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format(this.$gzlocale.format().shortTime)
: "";
},
dateOnly: {
get() {
return this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("YYYY-MM-DD");
},
set(value) {
this.date = this.$dayjs
.utc(value + " " + this.timeOnly)
.subtract(this.$gzlocale.timeZoneOffset, "hour")
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")
.toISOString();
}
},
@@ -139,13 +139,13 @@ export default {
get() {
return this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.add(this.$gzlocale.format().timeZoneOffset, "hour")
.format("HH:mm:ss");
},
set(value) {
this.date = this.$dayjs
.utc(this.dateOnly + " " + value)
.subtract(this.$gzlocale.timeZoneOffset, "hour")
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")
.toISOString();
}
}