This commit is contained in:
2020-02-07 00:10:31 +00:00
parent 2e05fd48fa
commit c7a9cdc8ee
2 changed files with 46 additions and 259 deletions

View File

@@ -79,20 +79,6 @@
<script>
/* Xeslint-disable */
export default {
// created() {
// debugger;
// },
beforeCreate() {
//check pre-requisites exist just in case
if (window.$gz.errorHandler.devMode()) {
if (!window.$gz.dayjs) {
throw "DateTimeControl: the DayJS library is required and missing";
}
if (!window.$gz.locale) {
throw "DateTimeControl: $gz.locale is required and missing";
}
}
},
data: () => ({
date: null,
oldDate: null,
@@ -146,12 +132,6 @@ export default {
this.languageName,
this.hour12
);
// return this.value
// ? window.$gz.dayjs
// .utc(this.value)
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
// .format(window.$gz.locale.format().shortDateAndTime)
// : "";
},
formatDate() {
return window.$gz.locale.utcDateToShortDateLocalized(
@@ -159,12 +139,6 @@ export default {
this.timeZoneName,
this.languageName
);
// return this.value
// ? window.$gz.dayjs
// .utc(this.value)
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
// .format(window.$gz.locale.format().shortDate)
// : "";
},
formatTime() {
return window.$gz.locale.utcDateToShortTimeLocalized(
@@ -173,47 +147,14 @@ export default {
this.languageName,
this.hour12
);
// return this.value
// ? window.$gz.dayjs
// .utc(this.value)
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
// .format(window.$gz.locale.format().shortTime)
// : "";
},
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 = window.$gz
// .dayjs()
// .utc()
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
// .format("YYYY-MM-DD");
// return this.value
// ? window.$gz.dayjs
// .utc(this.value)
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
// .format("YYYY-MM-DD")
// : defaultDateString;
// },
// set(value) {
// this.date = window.$gz.dayjs
// .utc(value + " " + this.timeOnly)
// .subtract(window.$gz.locale.format().timeZoneOffset, "hour")
// .toISOString();
// }
//---------------------------
get() {
//TODO: return date only portion converted to local working time zone: YYYY-MM-DD
var v = window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
//return date only portion converted to local working time zone: YYYY-MM-DD
return window.$gz.locale.utcDateStringToLocal8601DateOnlyString(
this.value,
this.timeZoneName
);
console.log(this.value);
console.log(v);
return v;
},
set(value) {
this.date = window.$gz.locale.localTimeDateStringToUTC8601String(