fix(workspace): 使用本地日期生成今日日报

This commit is contained in:
Script Generator
2026-06-26 15:43:31 +08:00
parent 8c3fec221b
commit d9b0236d1c
4 changed files with 23 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import { Plus, Trash2 } from 'lucide-react';
import { useTaskWorklogStore } from '@/stores/useTaskWorklogStore';
import { useAuthStore } from '@/stores/useAuthStore';
import { getTaskWorklogs } from '@/lib/task-worklog';
import { formatLocalDate } from '@/lib/format';
interface Props {
taskId: string;
@@ -17,7 +18,7 @@ export function WorklogPanel({ taskId }: Props) {
const taskLogs = getTaskWorklogs(worklogs, taskId);
const totalHours = taskLogs.reduce((sum, w) => sum + w.hours, 0);
const today = new Date().toISOString().slice(0, 10);
const today = formatLocalDate();
const [date, setDate] = useState(today);
const [hours, setHours] = useState<number>(1);
const [workContent, setWorkContent] = useState('');