rough outline of dragging tasks is working
This commit is contained in:
@@ -8,7 +8,8 @@ export class Event {
|
||||
public title: string,
|
||||
public from: DateTime,
|
||||
public to: DateTime,
|
||||
public description: string
|
||||
public description: string,
|
||||
public task: Task | undefined = undefined
|
||||
) { }
|
||||
|
||||
|
||||
@@ -144,6 +145,10 @@ export class Event {
|
||||
}
|
||||
}
|
||||
|
||||
isTask() {
|
||||
return this.task !== undefined
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export type EventDimensions = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DateTime } from "luxon"
|
||||
import { Event } from "./event"
|
||||
|
||||
export class Task {
|
||||
constructor(
|
||||
@@ -43,6 +44,18 @@ export class Task {
|
||||
isScheduled() {
|
||||
return this.scheduled_at !== undefined
|
||||
}
|
||||
|
||||
toEvent(): Event {
|
||||
const scheduledAt = this.scheduled_at ?? DateTime.now()
|
||||
return new Event(
|
||||
this.id,
|
||||
this.title,
|
||||
scheduledAt,
|
||||
scheduledAt.plus({ minutes: this.estimated_time }),
|
||||
this.description,
|
||||
this
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export type SimpleTask = {
|
||||
|
||||
Reference in New Issue
Block a user