This commit is contained in:
@@ -225,8 +225,8 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
valueStart = vm.$dayjs(valueStart);
|
||||
valueEnd = vm.$dayjs(valueEnd);
|
||||
valueStart = window.$gz.dayjs(valueStart);
|
||||
valueEnd = window.$gz.dayjs(valueEnd);
|
||||
|
||||
// if either is not valid.
|
||||
if (!valueStart || !valueEnd) {
|
||||
@@ -412,7 +412,7 @@ export default {
|
||||
//
|
||||
deleteAllErrorBoxErrors(vm) {
|
||||
//clear all keys from server error
|
||||
vm.$gzutil.removeAllPropertiesFromObject(vm.formState.serverError);
|
||||
window.$gz.util.removeAllPropertiesFromObject(vm.formState.serverError);
|
||||
//clear app errors
|
||||
vm.formState.appError = null;
|
||||
//clear out actual message box display
|
||||
@@ -457,7 +457,7 @@ export default {
|
||||
) {
|
||||
if (vm.formState.serverError.code == "2200") {
|
||||
//clear all keys from server error
|
||||
vm.$gzutil.removeAllPropertiesFromObject(vm.formState.serverError);
|
||||
window.$gz.util.removeAllPropertiesFromObject(vm.formState.serverError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,10 +60,10 @@ export default {
|
||||
//debugger;
|
||||
//check pre-requisites exist just in case
|
||||
if (this.$gzdevmode()) {
|
||||
if (!this.$dayjs) {
|
||||
if (!window.$gz.dayjs) {
|
||||
throw "DateTimeControl: the DayJS library is required and missing";
|
||||
}
|
||||
if (!this.$gzlocale) {
|
||||
if (!window.$gz.locale) {
|
||||
throw "DateTimeControl: $gzlocale is required and missing";
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
computed: {
|
||||
formatDateTime() {
|
||||
return this.value
|
||||
? this.$dayjs
|
||||
? window.$gz.dayjs
|
||||
.utc(this.value)
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.format().shortDateAndTime)
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
},
|
||||
formatDate() {
|
||||
return this.value
|
||||
? this.$dayjs
|
||||
? window.$gz.dayjs
|
||||
.utc(this.value)
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.format().shortDate)
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
},
|
||||
formatTime() {
|
||||
return this.value
|
||||
? this.$dayjs
|
||||
? window.$gz.dayjs
|
||||
.utc(this.value)
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format(this.$gzlocale.format().shortTime)
|
||||
@@ -125,20 +125,21 @@ export default {
|
||||
dateOnly: {
|
||||
get() {
|
||||
//TODO: this will likely need an improvement for forms where there should be an automatic pre-set time chosen like workorder labor;
|
||||
var defaultDateString = this.$dayjs()
|
||||
var defaultDateString = window.$gz
|
||||
.dayjs()
|
||||
.utc()
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format("YYYY-MM-DD");
|
||||
|
||||
return this.value
|
||||
? this.$dayjs
|
||||
? window.$gz.dayjs
|
||||
.utc(this.value)
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format("YYYY-MM-DD")
|
||||
: defaultDateString;
|
||||
},
|
||||
set(value) {
|
||||
this.date = this.$dayjs
|
||||
this.date = window.$gz.dayjs
|
||||
.utc(value + " " + this.timeOnly)
|
||||
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.toISOString();
|
||||
@@ -147,20 +148,20 @@ export default {
|
||||
timeOnly: {
|
||||
get() {
|
||||
//TODO: this will likely need an improvement for forms where there should be an automatic pre-set time chosen like workorder labor;
|
||||
var defaultTimeString = this.$dayjs
|
||||
var defaultTimeString = window.$gz.dayjs
|
||||
.utc()
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format("HH:mm:ss");
|
||||
|
||||
return this.value
|
||||
? this.$dayjs
|
||||
? window.$gz.dayjs
|
||||
.utc(this.value)
|
||||
.add(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.format("HH:mm:ss")
|
||||
: defaultTimeString;
|
||||
},
|
||||
set(value) {
|
||||
this.date = this.$dayjs
|
||||
this.date = window.$gz.dayjs
|
||||
.utc(this.dateOnly + " " + value)
|
||||
.subtract(this.$gzlocale.format().timeZoneOffset, "hour")
|
||||
.toISOString();
|
||||
|
||||
@@ -65,8 +65,8 @@ window.$gz = {
|
||||
//Object.defineProperty(Vue.prototype, "$gzevent", { value: gzeventbus });
|
||||
//Object.defineProperty(Vue.prototype, "$gzmenu", { value: gzmenu });
|
||||
//Object.defineProperty(Vue.prototype, "$gzdialog", { value: gzdialog });
|
||||
Object.defineProperty(Vue.prototype, "$gzutil", { value: gzutil });
|
||||
Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
|
||||
//Object.defineProperty(Vue.prototype, "$gzutil", { value: gzutil });
|
||||
//Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
|
||||
Object.defineProperty(Vue.prototype, "$_", { value: lodash });
|
||||
Object.defineProperty(Vue.prototype, "$gzlocale", { value: locale });
|
||||
Object.defineProperty(Vue.prototype, "$gzapi", { value: gzapi });
|
||||
|
||||
@@ -192,7 +192,7 @@ function clickHandler(menuItem) {
|
||||
) {
|
||||
logText += value + "\n";
|
||||
});
|
||||
this.$gzutil.copyToClipboard(text + "\nCLIENT LOG\n" + logText);
|
||||
window.$gz.util.copyToClipboard(text + "\nCLIENT LOG\n" + logText);
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventbus.$emit(
|
||||
|
||||
Reference in New Issue
Block a user