diff --git a/apps/calendar/apps/backend/src/calendar/calendar.service.ts b/apps/calendar/apps/backend/src/calendar/calendar.service.ts index c13adbbee..dea77d014 100644 --- a/apps/calendar/apps/backend/src/calendar/calendar.service.ts +++ b/apps/calendar/apps/backend/src/calendar/calendar.service.ts @@ -113,12 +113,56 @@ export class CalendarService { return updated; } - // Create a new default calendar - return this.create(userId, { - name: 'Mein Kalender', - isDefault: true, - color: '#3B82F6', - }); + // Create default calendars for new user + await this.createDefaultCalendars(userId); + + // Return the default one + const defaultCal = await this.db + .select() + .from(calendars) + .where(and(eq(calendars.userId, userId), eq(calendars.isDefault, true))); + + return defaultCal[0]; + } + + /** + * Create default calendars for a new user + */ + async createDefaultCalendars(userId: string): Promise { + const defaultCalendars = [ + { + name: 'PersΓΆnlich', + color: '#3B82F6', // Blue + isDefault: true, + description: 'Private Termine', + }, + { + name: 'Beruf', + color: '#10B981', // Green + isDefault: false, + description: 'Arbeit, Meetings, Projekte', + }, + { + name: 'Familie', + color: '#F97316', // Orange + isDefault: false, + description: 'Familientermine, Geburtstage', + }, + { + name: 'Freizeit', + color: '#8B5CF6', // Violet + isDefault: false, + description: 'Hobbies, Sport, Events', + }, + ]; + + const created: Calendar[] = []; + for (const cal of defaultCalendars) { + const calendar = await this.create(userId, cal); + created.push(calendar); + } + + return created; } private async clearDefaultCalendar(userId: string): Promise { diff --git a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte index c5cb6daa4..a4abe650a 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte @@ -1,5 +1,6 @@