rough outline of dragging tasks is working
This commit is contained in:
@@ -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