mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user