Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/services/TaskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,27 @@ export class TaskService {
icsEventId: taskData.icsEventId || undefined,
};

// Add DTSTART to recurrence rule if it doesn't have one
// This ensures Google Calendar sync works correctly from the start
if (
completeTaskData.recurrence &&
typeof completeTaskData.recurrence === "string" &&
!completeTaskData.recurrence.includes("DTSTART:")
) {
const tempTaskInfo: TaskInfo = {
...completeTaskData,
title: title,
status: status,
priority: priority,
path: "", // Path not yet known, but not needed for DTSTART calculation
archived: false,
};
const recurrenceWithDTSTART = addDTSTARTToRecurrenceRule(tempTaskInfo);
if (recurrenceWithDTSTART) {
completeTaskData.recurrence = recurrenceWithDTSTART;
}
}

const shouldAddTaskTag = this.plugin.settings.taskIdentificationMethod === "tag";
const taskTagForFrontmatter = shouldAddTaskTag
? this.plugin.settings.taskTag
Expand Down