Skip to content

Commit 466b71d

Browse files
committed
🐛 今日任务统计错误:每日重复任务错误统计了明日重复任务
1 parent acd9089 commit 466b71d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/reminderTaskLogic.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ export class ReminderTaskLogic {
229229

230230
private static getReminderLogicalDate(dateStr?: string, timeStr?: string): string {
231231
if (!dateStr) return '';
232-
return getLogicalDateString(new Date(dateStr + (timeStr ? 'T' + timeStr : 'T00:00:00')));
232+
// 如果没有时间,直接返回日期字符串,避免逻辑日期转换导致日期偏移
233+
// For tasks without time, return date string directly to avoid logical date offset
234+
if (!timeStr) {
235+
return dateStr;
236+
}
237+
return getLogicalDateString(new Date(dateStr + 'T' + timeStr));
233238
}
234239

235240
private static isSpanningEventTodayCompleted(reminder: any, reminderMap: Map<string, any>, today: string): boolean {

0 commit comments

Comments
 (0)