rough outline of dragging tasks is working

This commit is contained in:
2025-07-06 14:09:27 +02:00
parent 0297fab83b
commit ee19cac4c3
7 changed files with 72 additions and 7 deletions

View File

@@ -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 = {