This commit is contained in:
2019-05-28 23:52:12 +00:00
parent cddbf99177
commit 9b3dc8169c
4 changed files with 50 additions and 31 deletions

View File

@@ -99,50 +99,52 @@ export default {
computed: {
formatDateTime() {
return this.value
? this.$dayjs.utc(this.value)
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortDateAndTime)
: "";
},
formatDate() {
return this.value
? this.$dayjs.utc(this.value)
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortDate)
: "";
},
formatTime() {
return this.value
? this.$dayjs.utc(this.value)
? this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format(this.$gzlocale.formats.shortTime)
: "";
},
dateOnly: {
get() {
return this.$dayjs.utc(this.value)
return this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format("YYYY-MM-DD");
},
set(value) {
this.date = this.$dayjs.utc(value + " " + this.timeOnly)
this.date = this.$dayjs
.utc(value + " " + this.timeOnly)
.subtract(this.$gzlocale.timeZoneOffset, "hour")
.toISOString();
}
},
timeOnly: {
get() {
return this.$dayjs.utc(this.value)
return this.$dayjs
.utc(this.value)
.add(this.$gzlocale.timeZoneOffset, "hour")
.format("HH:mm:ss");//BUGBUG: Format here is converting it to local time unexpectedly
//this is because of the z in the utc source date and time which triggers format to convert to local time.
//for example this will show correctly (note no z at the end) timezoneoffset is -7:
//this.$dayjs("2019-05-28T19:01:00").add(this.$gzlocale.timeZoneOffset, "hour").format("HH:mm:ss") == "12:01:00"
//whereas this will not
//this.$dayjs("2019-05-28T19:01:00").add(this.$gzlocale.timeZoneOffset, "hour").format("HH:mm:ss") == "05:01:00" <-wrong!
.format("HH:mm:ss");
},
set(value) {
this.date = this.$dayjs.utc(this.dateOnly + " " + value)
this.date = this.$dayjs
.utc(this.dateOnly + " " + value)
.subtract(this.$gzlocale.timeZoneOffset, "hour")
.toISOString();
}

View File

@@ -26,37 +26,53 @@
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("UserTimeZoneOffset") }}:</span>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("UserTimeZoneOffset") }}:</span
>
<span class="body-2">{{ this.$gzlocale.timeZoneOffset }}</span>
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("DecimalSeparator") }}:</span>
<span class="body-2">{{ this.$gzlocale.formats.DecimalSeparator }}</span>
<div>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("DecimalSeparator") }}:</span
>
<span class="body-2">{{
this.$gzlocale.formats.DecimalSeparator
}}</span>
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("CurrencySymbol") }}:</span>
<span class="body-2">{{ this.$gzlocale.formats.currencySymbol }}</span>
<div>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("CurrencySymbol") }}:</span
>
<span class="body-2">{{
this.$gzlocale.formats.currencySymbol
}}</span>
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("ShortDateFormat") }}:</span>
<div>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("ShortDateFormat") }}:</span
>
<span class="body-2">{{ this.$gzlocale.formats.shortDate }}</span>
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("ShortTimeFormat") }}:</span>
<div>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("ShortTimeFormat") }}:</span
>
<span class="body-2">{{ this.$gzlocale.formats.shortTime }}</span>
</div>
<div>
<span class="ml-4 body-1">{{ this.$gzlocale.get("ShortDateAndTimeFormat") }}:</span>
<span class="body-2">{{ this.$gzlocale.formats.shortDateAndTime }}</span>
<div>
<span class="ml-4 body-1"
>{{ this.$gzlocale.get("ShortDateAndTimeFormat") }}:</span
>
<span class="body-2">{{
this.$gzlocale.formats.shortDateAndTime
}}</span>
</div>
<v-divider class="mt-4"></v-divider>
<v-subheader>{{ this.$gzlocale.get("Browser") }}</v-subheader>
<div v-for="(value, name) in clientInfo.browser" :key="name">

View File

@@ -140,7 +140,7 @@
<v-layout align-left justify-center row wrap mt-5>
<v-flex xs6 sm4>
endate: {{ obj.endDate }}
endate: {{ obj.endDate }}
<br />
<!-- READY: {{ formState.ready }}
<br />