This commit is contained in:
2020-01-30 00:45:32 +00:00
parent edb2527a4b
commit 8a5ed64a95
3 changed files with 37 additions and 4 deletions

View File

@@ -50,6 +50,10 @@ SHELL / NAV / MENUS / LAYOUT
TODO: main.js filters need to be finished
TODO: GRIDS
- MAKE GRID AS GENERIC VUE COMPONENT
- See gz-data-table.vue notes in component comments for it's own todo's

View File

@@ -212,8 +212,10 @@ function buildRecords(listData, columndefinitions, filters) {
display = filters.shortdatelocalized(display);
break;
case 2: //date only
display = filters.shortdateonlylocalized(display);
break;
case 3: //time only
display = filters.shorttimeonlylocalized(display);
break;
case 6: //bool
display = filters.boolastext(display);
@@ -224,13 +226,13 @@ function buildRecords(listData, columndefinitions, filters) {
case 8: //currency
display = filters.currency(display);
break;
case 10: //enum
case 10: //enum
display = filters.enum(display, columndefinitions[iColumn].et);
break;
default:
//do nothing, allow it to stay as is
}
o["c" + iColumn.toString()] = column.v;
o["c" + iColumn.toString()] = display;
}
ret.push(o);
}

View File

@@ -138,6 +138,9 @@ document.addEventListener("fetchEnd", function() {
/////////////////////////////////////////////////////////////////
// FILTERS
//
//TODO: These almost all need more work to format as proper numeric value (comma versus decimal etc)
Vue.filter("capitalize", function vueFilterCapitalize(value) {
if (!value) return "";
value = value.toString();
@@ -154,7 +157,31 @@ Vue.filter("shortdatelocalized", function vueFilterShortDateLocalized(value) {
.format(locale.format().shortDateAndTime);
});
//TODO: These need more work to format as proper numeric value (comma versus decimal etc)
//Convert date to localized value and return as short date format chosen
Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
value
) {
//TODO NOT DONE
if (!value) return "";
return dayjs
.utc(value)
.add(locale.format().timeZoneOffset, "hour")
.format(locale.format().shortDateAndTime);
});
//Convert date to localized value and return as short date format chosen
Vue.filter("shorttimeonlylocalized", function vueFilterShortTimeOnlyLocalized(
value
) {
//TODO NOT DONE
if (!value) return "";
return dayjs
.utc(value)
.add(locale.format().timeZoneOffset, "hour")
.format(locale.format().shortDateAndTime);
});
Vue.filter("currency", function vueFilterCurrency(value) {
if (!value) return "";
@@ -173,7 +200,7 @@ Vue.filter("boolastext", function vueFilterBoolAsText(value) {
Vue.filter("enum", function vueFilterDecimal(value, enumtype) {
if (!value) return "";
return enumtype + "." + value;
return enumtype + "." + value; //todo: actual values here
});
/////////////////////////////////////////////////////////////