This commit is contained in:
@@ -100,6 +100,10 @@ export default {
|
|||||||
oldDate: null,
|
oldDate: null,
|
||||||
dlgdate: false,
|
dlgdate: false,
|
||||||
dlgtime: false,
|
dlgtime: false,
|
||||||
|
//cache display format stuff
|
||||||
|
timeZoneName: window.$gz.locale.getTimeZoneName(),
|
||||||
|
languageName: window.$gz.locale.getBrowserLanguages(),
|
||||||
|
hour12: window.$gz.store.state.locale.hour12,
|
||||||
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0],
|
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0],
|
||||||
ampmFormat: window.$gz.locale.format().hour12 ? "ampm" : "24hr"
|
ampmFormat: window.$gz.locale.format().hour12 ? "ampm" : "24hr"
|
||||||
}),
|
}),
|
||||||
@@ -138,28 +142,45 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formatDateTime() {
|
formatDateTime() {
|
||||||
return this.value
|
return window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
? window.$gz.dayjs
|
this.value,
|
||||||
.utc(this.value)
|
this.timeZoneName,
|
||||||
.add(window.$gz.locale.format().timeZoneOffset, "hour")
|
this.languageName,
|
||||||
.format(window.$gz.locale.format().shortDateAndTime)
|
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() {
|
formatDate() {
|
||||||
return this.value
|
return window.$gz.locale.utcDateToShortDateLocalized(
|
||||||
? window.$gz.dayjs
|
this.value,
|
||||||
.utc(this.value)
|
this.timeZoneName,
|
||||||
.add(window.$gz.locale.format().timeZoneOffset, "hour")
|
this.languageName
|
||||||
.format(window.$gz.locale.format().shortDate)
|
);
|
||||||
: "";
|
// return this.value
|
||||||
|
// ? window.$gz.dayjs
|
||||||
|
// .utc(this.value)
|
||||||
|
// .add(window.$gz.locale.format().timeZoneOffset, "hour")
|
||||||
|
// .format(window.$gz.locale.format().shortDate)
|
||||||
|
// : "";
|
||||||
},
|
},
|
||||||
formatTime() {
|
formatTime() {
|
||||||
return this.value
|
return window.$gz.locale.utcDateToShortTimeLocalized(
|
||||||
? window.$gz.dayjs
|
this.value,
|
||||||
.utc(this.value)
|
this.timeZoneName,
|
||||||
.add(window.$gz.locale.format().timeZoneOffset, "hour")
|
this.languageName,
|
||||||
.format(window.$gz.locale.format().shortTime)
|
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: {
|
dateOnly: {
|
||||||
get() {
|
get() {
|
||||||
|
|||||||
@@ -450,22 +450,22 @@ function buildRecords(listData, columndefinitions, filters) {
|
|||||||
var display = column.v;
|
var display = column.v;
|
||||||
switch (dataType) {
|
switch (dataType) {
|
||||||
case 1: //datetime format to shortdatetime
|
case 1: //datetime format to shortdatetime
|
||||||
// display = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
display = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
// display,
|
display,
|
||||||
// timeZoneName,
|
timeZoneName,
|
||||||
// languageName,
|
languageName,
|
||||||
// hour12
|
hour12
|
||||||
// );
|
);
|
||||||
// break;
|
break;
|
||||||
// case 2: //date only
|
case 2: //date only
|
||||||
// display = window.$gz.locale.utcDateToShortDateLocalized(
|
display = window.$gz.locale.utcDateToShortDateLocalized(
|
||||||
// display,
|
display,
|
||||||
// timeZoneName,
|
timeZoneName,
|
||||||
// languageName
|
languageName
|
||||||
// );
|
);
|
||||||
// break;
|
break;
|
||||||
case 3: //time only
|
case 3: //time only
|
||||||
display = display = window.$gz.locale.utcDateToShortTimeLocalized(
|
display = window.$gz.locale.utcDateToShortTimeLocalized(
|
||||||
display,
|
display,
|
||||||
timeZoneName,
|
timeZoneName,
|
||||||
languageName,
|
languageName,
|
||||||
|
|||||||
Reference in New Issue
Block a user