fear: colors

This commit is contained in:
2025-03-12 10:54:52 +07:00
parent ae65ce43f4
commit e655bb5d5f
3 changed files with 11 additions and 12 deletions

View File

@@ -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()
}
}