Added general used methods and computed property to Abstract Mixin Component

. apiurl: returns app root and ci router from FHC_JS_DATA_OBJECT
. formatDateTime: returns human readable date time
. getDate: returns human readable date
This commit is contained in:
Cris
2022-10-25 12:54:35 +02:00
parent b6308d1ff5
commit 699b76f4cb
@@ -8,5 +8,23 @@ export default {
],
emits: [
"change" // TODO(chris): do we need this?
]
],
computed: {
apiurl() {
const app_root = FHC_JS_DATA_STORAGE_OBJECT.app_root;
const ci_router = FHC_JS_DATA_STORAGE_OBJECT.ci_router;
return app_root + ci_router;
}
},
methods: {
formatDateTime: function(dateTime) {
const dt = new Date(dateTime);
return dt.getDate() + '.' + dt.getMonth() + '.' + dt.getFullYear() + ' | '
+ dt.getHours() + ':' + dt.getMinutes();
},
getDate: function(dateTime){
const dt = new Date(dateTime);
return dt.getDate() + '.' + dt.getMonth() + '.' + dt.getFullYear();
}
}
}