From a6706864bfd14dfc5025c43a1cb788226d5c832d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 6 Mar 2019 20:53:15 +0000 Subject: [PATCH] --- .../src/components/gzdateandtimepicker.vue | 26 +++++++++---------- ayanova/src/views/inventory-widget-edit.vue | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ayanova/src/components/gzdateandtimepicker.vue b/ayanova/src/components/gzdateandtimepicker.vue index 722e436e..d744b4c4 100644 --- a/ayanova/src/components/gzdateandtimepicker.vue +++ b/ayanova/src/components/gzdateandtimepicker.vue @@ -45,7 +45,7 @@ export default { beforeCreate() { //created() { //check pre-requisites exist just in case - if (!this.$dayjs) { + if (!this.$dayjs) { throw "GzDateAndTimePicker: the DayJS library is required and missing"; } }, @@ -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(); } } diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index d1111646..591dd2c0 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -50,7 +50,7 @@ - +