This commit is contained in:
@@ -45,7 +45,7 @@ export default {
|
|||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
//created() {
|
//created() {
|
||||||
//check pre-requisites exist just in case
|
//check pre-requisites exist just in case
|
||||||
if (!this.$xdayjs) {
|
if (!this.$dayjs) {
|
||||||
throw "GzDateAndTimePicker: the DayJS library is required and missing";
|
throw "GzDateAndTimePicker: the DayJS library is required and missing";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,20 +11,22 @@ import errorHandler from "./api/errorhandler";
|
|||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
import "nprogress/nprogress.css";
|
import "nprogress/nprogress.css";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import locale from "./api/locale";
|
||||||
import gzdateandtimepicker from "./components/gzdateandtimepicker.vue";
|
import gzdateandtimepicker from "./components/gzdateandtimepicker.vue";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// LIBS AND GLOBAL STUFF
|
// LIBS AND GLOBAL ITEMS
|
||||||
// (https://medium.com/js-dojo/use-any-javascript-library-with-vue-js-3f7e2a4974a8)
|
// (https://medium.com/js-dojo/use-any-javascript-library-with-vue-js-3f7e2a4974a8)
|
||||||
//
|
//
|
||||||
Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
|
Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
|
||||||
|
Object.defineProperty(Vue.prototype, "$gzlocale", { value: locale });
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// FORM VALIDATION
|
// FORM VALIDATION
|
||||||
//
|
//
|
||||||
import VeeValidate from "vee-validate";
|
import VeeValidate from "vee-validate";
|
||||||
Vue.use(VeeValidate);
|
Vue.use(VeeValidate);
|
||||||
Vue.config.productionTip = false;
|
//Vue.config.productionTip = false;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// ERROR HANDLING
|
// ERROR HANDLING
|
||||||
|
|||||||
@@ -89,37 +89,13 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// type="checkbox"
|
// type="checkbox"
|
||||||
//import store from "../store";
|
//import store from "../store";
|
||||||
import locale from "../api/locale";
|
//import locale from "../api/locale";
|
||||||
import api from "../api/apiutil";
|
import api from "../api/apiutil";
|
||||||
//import dayjs from "dayjs";
|
//import dayjs from "dayjs";
|
||||||
//import _ from "../utils/libs/lodash.js";
|
//import _ from "../utils/libs/lodash.js";
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
beforeCreate() {
|
||||||
data() {
|
//debugger;
|
||||||
return {
|
|
||||||
obj: {},
|
|
||||||
lc: locale,
|
|
||||||
// dayjsLib: dayjs,
|
|
||||||
theDate: new Date(),
|
|
||||||
date: new Date().toISOString().substr(0, 10),
|
|
||||||
menu: false,
|
|
||||||
modal: false,
|
|
||||||
menu2: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// dateFormatted() {
|
|
||||||
// // var value = this.obj.startDate;
|
|
||||||
// // if (!value) return "";
|
|
||||||
// // var dj = dayjs(value);
|
|
||||||
// // return dj.format("YYYY-MM-DD hh:mm:ss A");
|
|
||||||
// return this.obj.startDate
|
|
||||||
// ? dayjs(this.obj.startDate).format("YYYY-MM-DD hh:mm:ss A")
|
|
||||||
// : "";
|
|
||||||
// //return this.obj.startDate ? moment(this.date).format("dddd, MMMM Do YYYY") : "";
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
beforeRouteEnter(to, from, next) {
|
|
||||||
//Cache all required lt keys
|
//Cache all required lt keys
|
||||||
var ltKeysRequired = [
|
var ltKeysRequired = [
|
||||||
"Widget",
|
"Widget",
|
||||||
@@ -147,13 +123,71 @@ export default {
|
|||||||
"WidgetCustom14",
|
"WidgetCustom14",
|
||||||
"WidgetCustom15",
|
"WidgetCustom15",
|
||||||
"WidgetCustom16"
|
"WidgetCustom16"
|
||||||
].concat(locale.commonKeysEditForm);
|
].concat(this.$gzlocale.commonKeysEditForm);
|
||||||
locale.fetch(ltKeysRequired).then(() => {
|
this.$gzlocale.fetch(ltKeysRequired);
|
||||||
next();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
obj: {},
|
||||||
|
lc: this.$gzlocale,
|
||||||
|
// dayjsLib: dayjs,
|
||||||
|
theDate: new Date(),
|
||||||
|
date: new Date().toISOString().substr(0, 10),
|
||||||
|
menu: false,
|
||||||
|
modal: false,
|
||||||
|
menu2: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// dateFormatted() {
|
||||||
|
// // var value = this.obj.startDate;
|
||||||
|
// // if (!value) return "";
|
||||||
|
// // var dj = dayjs(value);
|
||||||
|
// // return dj.format("YYYY-MM-DD hh:mm:ss A");
|
||||||
|
// return this.obj.startDate
|
||||||
|
// ? dayjs(this.obj.startDate).format("YYYY-MM-DD hh:mm:ss A")
|
||||||
|
// : "";
|
||||||
|
// //return this.obj.startDate ? moment(this.date).format("dddd, MMMM Do YYYY") : "";
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
,
|
||||||
|
// beforeRouteEnter(to, from, next) {
|
||||||
|
// // debugger;
|
||||||
|
// //Cache all required lt keys
|
||||||
|
// var ltKeysRequired = [
|
||||||
|
// "Widget",
|
||||||
|
// "WidgetName",
|
||||||
|
// "WidgetSerial",
|
||||||
|
// "WidgetDollarAmount",
|
||||||
|
// "WidgetCount",
|
||||||
|
// "WidgetRoles",
|
||||||
|
// "WidgetStartDate",
|
||||||
|
// "WidgetEndDate",
|
||||||
|
// "WidgetNotes",
|
||||||
|
// "WidgetCustom1",
|
||||||
|
// "WidgetCustom2",
|
||||||
|
// "WidgetCustom3",
|
||||||
|
// "WidgetCustom4",
|
||||||
|
// "WidgetCustom5",
|
||||||
|
// "WidgetCustom6",
|
||||||
|
// "WidgetCustom7",
|
||||||
|
// "WidgetCustom8",
|
||||||
|
// "WidgetCustom9",
|
||||||
|
// "WidgetCustom10",
|
||||||
|
// "WidgetCustom11",
|
||||||
|
// "WidgetCustom12",
|
||||||
|
// "WidgetCustom13",
|
||||||
|
// "WidgetCustom14",
|
||||||
|
// "WidgetCustom15",
|
||||||
|
// "WidgetCustom16"
|
||||||
|
// ].concat(this.$gzlocale.commonKeysEditForm);
|
||||||
|
// this.$gzlocale.fetch(ltKeysRequired).then(() => {
|
||||||
|
// next();
|
||||||
|
// });
|
||||||
|
// },
|
||||||
mounted() {
|
mounted() {
|
||||||
//debugger;
|
// debugger;
|
||||||
// this.getDataFromApi();
|
// this.getDataFromApi();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -184,7 +218,7 @@ export default {
|
|||||||
test() {
|
test() {
|
||||||
// debugger;
|
// debugger;
|
||||||
|
|
||||||
console.log(this.lc.decimalParse(this.obj.dollarAmount));
|
//console.log(this.lc.decimalParse(this.obj.dollarAmount));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user