refactor tag components and tagCreate events, change global week_start and timezone settings, fix pie charts

This commit is contained in:
Gregor Vostrak
2024-07-15 17:20:07 +02:00
parent 10d8540e6c
commit 655723db49
25 changed files with 255 additions and 133 deletions

View File

@@ -11,7 +11,14 @@ function getCurrentUserId() {
}
function getWeekStart() {
return page.props.auth.user.week_start;
const weekStart = window?.getWeekStartSetting() as string;
if (!weekStart) {
throw new Error(
'Please make sure to provide the current user week start setting as a vue inject (week_start)'
);
}
return weekStart;
}
function getCurrentOrganizationId() {
@@ -31,7 +38,13 @@ function getCurrentRole() {
}
function getUserTimezone() {
return page.props.auth.user.timezone;
const timezone = window?.getTimezoneSetting() as string;
if (!timezone) {
throw new Error(
'Please make sure to provide the current user timezone as a vue inject (timezone)'
);
}
return timezone;
}
export {