fix: AI创建循环提醒时添加next_reminder_date计算

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ddshi 2026-03-03 20:27:34 +08:00
parent 8ed7eb9154
commit 1e019aa431

View File

@ -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);