diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 35b459a..cb61fe7 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,12 +1,9 @@ diff --git a/frontend/src/components/calendar/event.class.ts b/frontend/src/components/calendar/event.class.ts index 34766ee..0dd7338 100644 --- a/frontend/src/components/calendar/event.class.ts +++ b/frontend/src/components/calendar/event.class.ts @@ -1,10 +1,12 @@ import { toSimpleDateString } from "../../utils/date/converters.util" +type Color = "red" | "yellow" | "blue" | "green" | "pink" + export class CalendarEvent { id: string title: string description: string - color: "red" | "yellow" | "blue" + color: Color with?: string time: { start: string; end: string } @@ -13,8 +15,8 @@ export class CalendarEvent { description: string, timeStart: Date, timeEnd: Date, - withPerson?: string, - color: "red" | "yellow" | "blue" = "red" + options: { withPerson?: string, + color: Color } ) { this.title = title this.description = description @@ -22,8 +24,8 @@ export class CalendarEvent { start: toSimpleDateString(timeStart), end: toSimpleDateString(timeEnd), } - this.with = withPerson - this.color = color + this.with = options.withPerson + this.color = options.color ?? 'red' this.id = new Date().getTime().toString() } } \ No newline at end of file diff --git a/frontend/src/pages/Index.vue b/frontend/src/pages/Index.vue index 8ac36c7..a75197b 100644 --- a/frontend/src/pages/Index.vue +++ b/frontend/src/pages/Index.vue @@ -9,8 +9,9 @@ const newEvent = new CalendarEvent( "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores assumenda corporis doloremque et expedita molestias necessitatibus quam quas temporibus veritatis. Deserunt excepturi illum nobis perferendis praesentium repudiandae saepe sapiente voluptatem!", new Date("2025-03-11T12:05:00"), new Date("2025-03-12T13:35:00"), - "Chandler Bing", - "red" + { + color: 'pink', + } ) events.push(newEvent)