fix: AI创建循环提醒时添加next_reminder_date计算
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8ed7eb9154
commit
1e019aa431
@ -22,6 +22,7 @@ import {
|
|||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import { api } from '../../services/api';
|
import { api } from '../../services/api';
|
||||||
import { useAppStore } from '../../stores';
|
import { useAppStore } from '../../stores';
|
||||||
|
import { calculateNextReminderDate } from '../../utils/repeatCalculator';
|
||||||
import type { AIConversation, AIParsedEvent, RepeatType, PriorityType } from '../../types';
|
import type { AIConversation, AIParsedEvent, RepeatType, PriorityType } from '../../types';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
|
|
||||||
@ -124,6 +125,11 @@ export function FloatingAIChat({ onEventCreated, hidden = false }: FloatingAICha
|
|||||||
if (!parsedEvent) return;
|
if (!parsedEvent) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 计算下一次提醒日期
|
||||||
|
const nextReminderDate = editForm.repeat_type !== 'none' && editForm.date
|
||||||
|
? calculateNextReminderDate(editForm.date, editForm.repeat_type as RepeatType, undefined)
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const eventData = {
|
const eventData = {
|
||||||
type: editForm.type,
|
type: editForm.type,
|
||||||
title: editForm.title,
|
title: editForm.title,
|
||||||
@ -134,6 +140,7 @@ export function FloatingAIChat({ onEventCreated, hidden = false }: FloatingAICha
|
|||||||
is_holiday: editForm.is_holiday,
|
is_holiday: editForm.is_holiday,
|
||||||
priority: editForm.priority,
|
priority: editForm.priority,
|
||||||
reminder_times: editForm.reminder_times,
|
reminder_times: editForm.reminder_times,
|
||||||
|
next_reminder_date: nextReminderDate,
|
||||||
};
|
};
|
||||||
|
|
||||||
await api.events.create(eventData);
|
await api.events.create(eventData);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user