diff --git a/src/components/ai/FloatingAIChat.tsx b/src/components/ai/FloatingAIChat.tsx index fa09643..2a1f00d 100644 --- a/src/components/ai/FloatingAIChat.tsx +++ b/src/components/ai/FloatingAIChat.tsx @@ -22,6 +22,7 @@ import { } from '@tabler/icons-react'; import { api } from '../../services/api'; import { useAppStore } from '../../stores'; +import { calculateNextReminderDate } from '../../utils/repeatCalculator'; import type { AIConversation, AIParsedEvent, RepeatType, PriorityType } from '../../types'; import { notifications } from '@mantine/notifications'; @@ -124,6 +125,11 @@ export function FloatingAIChat({ onEventCreated, hidden = false }: FloatingAICha if (!parsedEvent) return; try { + // 计算下一次提醒日期 + const nextReminderDate = editForm.repeat_type !== 'none' && editForm.date + ? calculateNextReminderDate(editForm.date, editForm.repeat_type as RepeatType, undefined) + : undefined; + const eventData = { type: editForm.type, title: editForm.title, @@ -134,6 +140,7 @@ export function FloatingAIChat({ onEventCreated, hidden = false }: FloatingAICha is_holiday: editForm.is_holiday, priority: editForm.priority, reminder_times: editForm.reminder_times, + next_reminder_date: nextReminderDate, }; await api.events.create(eventData);