feat: create event with click and drag

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-07 21:36:50 -04:00
parent 019b0b6367
commit 992825c291
4 changed files with 168 additions and 19 deletions
+4 -4
View File
@@ -61,12 +61,12 @@ export const useChronoUiStore = defineStore('chronoUiStore', () => {
showTaskEditor.value = type === 'task'
}
function createEventFromDate(date?: Date) {
function createEventFromDate(start?: Date, end?: Date) {
const entity = new EntityObject()
entity.properties = new EventObject()
if (date) {
entity.properties.startsOn = date.toISOString()
entity.properties.endsOn = new Date(date.getTime() + 60 * 60 * 1000).toISOString()
if (start) {
entity.properties.startsOn = start.toISOString()
entity.properties.endsOn = (end ?? new Date(start.getTime() + 60 * 60 * 1000)).toISOString()
}
openEntityEditor(entity, 'event', 'edit')
}