mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 10:12:17 +01:00
move multiselect components, week start and timezon functions to ui package
This commit is contained in:
19
resources/js/packages/ui/src/utils/settings.ts
Normal file
19
resources/js/packages/ui/src/utils/settings.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export function getWeekStart() {
|
||||
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;
|
||||
}
|
||||
export function getUserTimezone() {
|
||||
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;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import isYesterday from 'dayjs/plugin/isYesterday';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import timezone from 'dayjs/plugin/timezone';
|
||||
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
||||
import { getUserTimezone, getWeekStart } from '@/utils/useUser';
|
||||
import { getUserTimezone, getWeekStart } from './settings';
|
||||
import updateLocale from 'dayjs/plugin/updateLocale';
|
||||
import { computed } from 'vue';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user