fear: colors
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user